using System.Collections; using System.Collections.Generic; using UnityEngine; public class bigbangmove : MonoBehaviour { public float Speed; public GameObject explode; // Use this for initialization void Start () { explode = Resources.Load("Prefabs/Explode"); } // Update is called once per frame void Update () { transform.Translate(Vector3.up*Speed*Time.deltaTime); } private void OnTriggerEnter(Collider other) { if (other.tag=="stone") { GameObject go = Instantiate(explode); go.transform.position = other.transform.position; Destroy(other.gameObject); ScoreManager.instance.Score+=10; } } }