void Update() { if (Input.GetKeyDown(KeyCode.E)) { transform.parent = null; ExplosionCollider.SetActive(true); rb.AddExplosionForce(explosionForce, transform.position, radius, mod); Destroy(obj, 0.1f); } }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); rb.velocity *= force; ExplosionCollider.SetActive(false); }