Hey! I have a basic boxcollider which is trigger. When I enter inside the trigger zone and press "E" I want to trigger a conversation. How can I do that?
-Pepe
How to trigger dialogue from script?
Re: How to trigger dialogue from script?
Hi,
Use a Proximity Selector.
On the player, add a Rigidbody, collider, Proximity Selector, and Selector Use Standard UI Elements. Set the Proximity Selector's Use Key to E, and set the Use Message to something like "E) Interact".
On the basic boxcollider, add a Rigidbody (tick Is Kinematic), Usable, and Dialogue System Trigger. On the Dialogue System Trigger, select Add Actions > Start Conversation, and select your conversation.
Make sure the player's layer and the boxcollider's layer are configured to register collisions. (Edit > Project Settings > Physics)
Use a Proximity Selector.
On the player, add a Rigidbody, collider, Proximity Selector, and Selector Use Standard UI Elements. Set the Proximity Selector's Use Key to E, and set the Use Message to something like "E) Interact".
On the basic boxcollider, add a Rigidbody (tick Is Kinematic), Usable, and Dialogue System Trigger. On the Dialogue System Trigger, select Add Actions > Start Conversation, and select your conversation.
Make sure the player's layer and the boxcollider's layer are configured to register collisions. (Edit > Project Settings > Physics)