- Home /
Character Controller OnControllerColliderHit Problem
I'm having some issues with my CharacterController and collisions, The OnControllerColliderHit(); function works great in most cases, but It seems to be effected by the speed of the CharacterController.
I have a simple setup: 1 CharacterController using controller.Move to move it around, and 1 Trigger. The CharacterController is moving at a velocity of more than 10 the OnControllerColliderHit(); does not register the entering of the Trigger.
The trigger is not small in fact it's 20x20x20, and the CharacterController is 1x1x1 so there is plenty of time for the frame to refresh and the OnControllerColliderHit(); to register all the collisions.
Any idea on what is cause / can solve my problem.
Cheers - C
Answer by Owen-Reynolds · Nov 15, 2011 at 04:41 PM
ContCollideHit doesn't fire on triggerBoxes -- only on hitting "real" colliders (turn off triggerbox -- it will fire like crazy.) Easiest to have the triggerBox script do the checking. A charController, no extra colliders attached, will fire this:
void OnTriggerEnter(Collider cc) {
if(cc.transform.CompareTag("Player")==true) { // be sure the player is tagged
Cheers, just wanted to know the best approach, switching the check seems responsible. Any reason why occasionally the CharacterController does fire on a triggerBox? seems weird that it works on occasion.
Just want to expand on that, when ever my CharacterController "jumps" the trigger no longer fires, again thats very strange.
Your answer
Follow this Question
Related Questions
How can I make an enemy hurt the player? 3 Answers
How to fix the position of a character when grabbing a rope? 1 Answer
How do I detect when two CharacterControllers collide? 0 Answers
How to have other (any) Objects smoothly push a Character Controller? 1 Answer
Damage Player when this object collides the CharacterController? 2 Answers