using System.Collections; using System.Collections.Generic; using UnityEngine; public class Projectile : MonoBehaviour { private Vector2 vel; private Rigidbody2D rb; private BoxCollider2D bc; void Start() { rb = GetComponent(); bc = GetComponent(); vel = rb.velocity; GetComponent().enabled = false; } void FixedUpdate() { rb.velocity = vel; } void OnTriggerEnter2D(Collider2D bc) { Destroy(gameObject); } }