Page 1 of 1

On Trigger Enter sometimes not working

Posted: Wed Mar 02, 2022 9:49 pm
by GreenConure
Hello again!

I'm currently running into this instance of conversations set to On Trigger Enter not working sometimes. I have 2D physics enabled and the game object includes a Box 2D collider, a DS trigger, with tags set to the player.

What's currently happening is that sometimes these conversations work, and sometimes they don't. When this happens, what usually solves it for me is to copy another existing On Trigger enter conversation and replace the conversation it starts. However, there is no difference in their setup or components. Would you have any idea as to what could be causing this?

Let me know if there's any other information I can give.
Thank you!

Re: On Trigger Enter sometimes not working

Posted: Thu Mar 03, 2022 6:54 am
by Error412
Hi, is there is any chance that you could share a sample of your project, or a test scene reproducing this issue? Sometimes the collider area is too small by default on some objects but this doesn't seem your issue.

Re: On Trigger Enter sometimes not working

Posted: Thu Mar 03, 2022 8:05 am
by Tony Li
You might need to add a Rigidbody2D component. You can set it to Kinematic to prevent it from being moved by physics forces.

If that doesn't fix it, check the GameObject's layer. If you've specified in the Edit > Project Settings > Physics 2D collision matrix that certain layers should register collisions, then make sure the GameObject is on a layer that registers collisions with the player's layer.

Re: On Trigger Enter sometimes not working

Posted: Fri Mar 04, 2022 5:56 am
by GreenConure
Hi! That worked well! Thank you so much again. :)

Re: On Trigger Enter sometimes not working

Posted: Fri Mar 04, 2022 8:41 am
by Tony Li
Glad to help!