- Home /
OnTriggerEnter calling on wrong objects
I have very strange issue. I have a Projectile class with a Trigger capsule on it. It has an OnTriggerEnter event to kill any badguy it hits (it can only collide with the hitboxes layer). All this works as planned 90% of the time, but for some reason, on rare occasions (it appears when the projectile hits the ground-plane, a plane with a boxcollider in the "environment" layer), the OnTriggerEnter event gets called every frame, and the "other" variable passed in is for every badguy in the scene, all quite a physical ways away from the offending projectile.
I am at my wits end, the scene isn't exactly complex (it's just a whitebox room for prototyping gameplay). Does anyone have any idea how OnTriggerEnter could be getting called with an incorrect collision object? It seems like some kind of bizarre reference error, as when it happens, it effects all of the badguy objects in the scene at the same time and they all suddenly die. The weirdest thing is that the two colliders aren't anywhere near each other (I've paused it on collision, and watched the only projectile in the scene be 30 units away from the only bad guys, and they all trigger the collision every frame). Any guidance would be greatly appreciated.
-Sean
Your answer
Follow this Question
Related Questions
OnTriggerEnter Colliders stops working with Zigfu Kinect 0 Answers
overlapping colliders 1 Answer
Lock camera (on) ontriggerenter 1 Answer