public void Go() { r.AddForce(i.AttachedHand.CurrentForward * force, ForceMode.VelocityChange); //i.AttachedHands.Clear (); i.EndInteraction(i.AttachedHand); if (e != null) { e.Activate(); } }
// Update is called once per frame void Update() { if (go) { RaycastHit[] hit = Physics.RaycastAll(this.transform.position, this.transform.forward, 1.3f); for (int i = 0; i < hit.Length; i++) { if (hit[i].rigidbody != null) { hit[i].rigidbody.AddForce(this.transform.forward * force, ForceMode.Impulse); Explo e = hit[i].transform.GetComponent <Explo> (); if (e != null) { e.Activate(); } } } } if (interact) { munition = Physics.RaycastAll(this.transform.position, this.transform.forward, 1.3f); } }