Dialog with on trigger enter
-
- Posts: 4
- Joined: Sat Dec 09, 2023 4:21 am
Dialog with on trigger enter
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
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.
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.
-
- Posts: 4
- Joined: Sat Dec 09, 2023 4:21 am
Re: Dialog with on trigger enter
Thanks for the quick info. It works fine.
Re: Dialog with on trigger enter
Glad to help!