void OnCollisionEnter(Collision tanque) { Debug.Log(tanque.gameObject.tag); if (tanque.gameObject.CompareTag("Player")) { MotorLau other = (MotorLau)tanque.gameObject.GetComponent(typeof(MotorLau)); other.Destruir(); } }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody>(); motor = GetComponent <MotorLau>(); }