This is an example scene exported from Unity 2020 using the built-in input manager:How would I make a line from a conversation trigger when I click on an object in a 3D game? Basically I want the conversation to go on and to have objects you click on in the world be the way you make decisions for what to say next.
DS_ReplyInSceneExample_2022-01-04.unitypackage
The scene has a Cube and a Sphere.
A conversation plays as soon as the scene starts. The first node asks the user to "Click on the sphere." Its Sequence is set to:
Code: Select all
WaitForMessage(ClickedObject)
The Sphere has a Dialogue System Trigger that sets a Dialogue System variable named "Object" to the value "Sphere". It also has a small script that, when the object is clicked, invokes the Dialogue System Trigger and then sends the sequencer message "Clicked Object".
The Cube is set up similarly except it sets the "Object" variable to "Cube".
The conversation then checks whether the "Object" variable is set to "Sphere" or not. Note that Conversations Evaluate Conditions One Extra Level Ahead so there's an intermediate node between the first node and the nodes that check the "Object" variable. [Note: The intermediate node isn't necessary if you've ticked the Dialogue Manager's Other Settings > Reevaluate Links After Subtitle checkbox.]
You can use this same idea for tutorial conversations. Use the WaitForMessage() sequencer command to make the conversation wait for the player to complete a task in the tutorial.