Pls help! How do I display a GUI message from the above script…I want to be able to see a “Collision!!!” message in GUI when the collision occurs…pls how do I go about that?.
This is the code I used to detect collisions, it plays a sound when my game character tagged as player hits a cube tagged as Enemy…thanks in advance.
function OnControllerColliderHit (hit : ControllerColliderHit)
{
if (hit.gameObject.tag == "Enemy")
{
audio.PlayOneShot (impact);
}
}