- Home /
why does not my onControllerColliderHit() not get activated when i hit a collider
My onControllerColliderHit doesnt work...i need to activate a certain code when i reach the proximity of an object. in the scripting reference it is said this function onControllerColliderHit is called wen collision occurs ..bt it doesnt...please help
Answer by Mike 3 · Jul 28, 2010 at 11:07 AM
Make sure your function starts with a capital O (like every function in unity) : OnControllerColliderHit
If that's not it, edit the function itself into your question and I'll check it over
Answer by sovalopivia · Jul 28, 2010 at 12:01 PM
Also, make sure you have an actual collider attached to the target.
Answer by KGB · Feb 07, 2012 at 11:59 PM
In Order to be fired OnControllerColliderHit method, you have to move your CharacterControler using Move or SimpleMove Method, otherwise it will not be fired.