Triggers
public class PhysicsTest : MonoBehaviour {
void OnTriggerEnter(Collider collisionInfo){
if (collisionInfo.gameObject.tag == "Player"){
collisionInfo.gameObject.GetComponent<Renderer>().
material.color = Color.green;
}
}
void OnTriggerStay(Collider collisionInfo){
if (collisionInfo.gameObject.tag == "Player"){
collisionInfo.gameObject.GetComponent<Renderer>().
material.color = Color.red;
}
}
void OnTriggerExit(Collider collisionInfo){
if (collisionInfo.gameObject.tag == "Player"){
collisionInfo.gameObject.GetComponent<Renderer>().
material.color = Color.blue;
}
}
}