I am reading the book about unity3d from Will Goldstone. Currently i’m in chapter 4 were we have to check if our character collides with another object.
Therefore we use the onControllerColliderHit function however it does not seem to trigger on me…
THis is the script:
function onControllerColliderHit(hit: ControllerColliderHit)
{
print("Collide");
if(hit.gameObject.tag == "outpostDoor" doorIsOpen == false)
{
currentDoor = hit.gameObject;
Door(doorOpenSound,true,"dooropen",currentDoor);
}
}
That print never shows… When i’m colliding with the door, my char stops so i guess the engine realy detects that i’m hitting the collider of the object.
My script is on a gameObject with a FPSWalker script and a Character Controller on it.
Anybody knows what i could have been doing wrong?