Exemple #1
0
 void OnTriggerStay(Collider other)
 {
     if (other.tag == "Player")
     {
         player = other.GetComponent <Chara>();
         Debug.Log(other.gameObject.name + " has stepped on " + gameObject.name);
         player.GetComponent <Rigidbody>().AddExplosionForce(strength, transform.position, strength);
         //player.GetComponent<Rigidbody>().AddRelativeForce(transform.up * strength, ForceMode.Acceleration);
     }
 }