using System.Collections; using System.Collections.Generic; using UnityEngine; public class TripleShot : MonoBehaviour { private float _speed = 12; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { CalculateMovement(); } void CalculateMovement() { transform.Translate(Vector3.up * _speed * Time.deltaTime); if (transform.position.y > 8f) { if (transform.parent != null) { Destroy(transform.parent.gameObject); } Destroy(this.gameObject); } } }