Problem with the collider triggers,My collider trigger is not working
Ok, so I am making a zombie survival game. I have a zombie object, that has an empty object child which has a sphere collider (isTrigger = true) and a rigidbody (isKinematic = true). This sphere collider has a whide range and Is checking for a player entering in the detection zone (later called Player Detector). Player and zombie has a capsule collider and rigidbody. The Player Detector has a script, that's listening to OnCollisionEnter() calls and then flips a public bool that is used by Zombies main script. It seems that the Player Detector collider isn't triggered by anything (even the terrain). Any suggestions why that would be?
P.S. Player Detector doesn't even detect the Zombie collider, even if it's right in the middle of the sphere collider (The Player Detector collider).
Answer by The_Three_Vs · Mar 31, 2020 at 07:33 PM
When isTrigger is on, OnCollisionEnter is never called. You need to use OnTriggerEnter instead.
Hope this helps!
Your answer
![](https://koobas.hobune.stream/wayback/20220612230059im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Any way to add physical box colliders to an object with Character Controller ? 0 Answers
3D Trigger collider slows player moved by forces 0 Answers
onTriggerEnter returns wrong object's attribute 1 Answer
NEED HELP!!! How to explode my enemy ship? Need help with C# script 1 Answer
multiple objects with triggers that need to ignore the triggers but still collide with eachother? 0 Answers