Hi all,
I have an issue with OnTriggerEnter2D firing multiple times when a target’s animator component is turned on. I’ve 25080-trigger2dproblem.zip (179 KB) to demonstrate the problem.
I created 2 entities, one called Car and one called Person, with the following settings:
The scene starts out with the Car to the left of the Person. The Car moves toward the person using the Car’s rigidbody2D’s velocity. If the Person’s Animator component is on, the OnTriggerEnter2D in the Car script will fire what looks to be every frame their colliders intersect. When I turn the Animator component off, it behaves expected and OnTriggerEnter2D only fires once. It doesn’t matter if anything is even physically moving - I created an empty state for the Person’s controller and set it as default and it still triggers multiple OnTriggerEnter2D’s.
I set up this scenario with regular 3D colliders and it behaves as I expected, so I’m leaning toward this being a bug with the new 2D tools, but I’d like to be sure.
I’ve already tried searching for OnTriggerEnter2D issues on Answers and on Google, but most of them either involve triggers not working, or assumed to be firing multiple times because of a symptom arising from bad code.
Any help appreciated, thanks very much!