Hi! I’ve got a problem with the “OnControllerColliderHit”. I use this function in the FirstPersonController. When the player hit a campfire, campfire must light. It’s not working - the function OnControllerColliderHit is not called. Can you tell me what I’m doing wrong?
Part of the script:
void OnControlerColliderHit(ControllerColliderHit col)
{
if(col.gameObject.name == "campfire")
{
if(haveMatches)
{
LightFire(col.gameObject);
}
else
{
textHints.SendMessage("ShowHint", "MESSAGE");
}
}
}
void LightFire(GameObject campfire)
{
campfire.GetComponentInChildren<ParticleSystem>().Play();
campfire.audio.Play();
Destroy(matchGUI);
haveMatches = false;
}