Page 1 of 1

Dialog with on trigger enter

Posted: Sat Dec 09, 2023 4:29 am
by grinseengel
Hello, I am a beginner when it comes to the dialog system. I have already had my first small successes. Now I would like a dialog to start only when I touch a npc as a player. I have selected On Trigger Enter in the "dialog System Trigger". Then I added the player tag. The NPC and also the player have a collision box which I have set to Trigger. However, the dialog does not open when I touch the NPC. If I use "on Use" as the trigger, it works without any problems. Does anyone have any idea why my collision event is not working?

Re: Dialog with on trigger enter

Posted: Sat Dec 09, 2023 8:52 am
by Tony Li
Hi,

Thanks for using the Dialogue System!

"On Trigger Enter" depends on Unity registering a collision with a trigger collider. Try adding Rigibody (or Rigidbody2D) components to your player and NPC. You can set them to Kinematic so they're not affected by the physics system. Also check the GameObjects' layers against the collision matrix in menu item Edit > Project Settings -> Physics / Physics2D. And make sure the player GameObject's Tag is set to Player.

Re: Dialog with on trigger enter

Posted: Mon Dec 11, 2023 9:33 am
by grinseengel
Thanks for the quick info. It works fine.

Re: Dialog with on trigger enter

Posted: Mon Dec 11, 2023 9:42 am
by Tony Li
Glad to help!