I'm working on a "click-to-move" game, and what I'm trying to accomplish is this:
1. Click on NPC
2. Move player towards NPC
3. Trigger Dialogue when Player gets close to NPC only when the NPC was the last thing clicked
What would be the best-practice approach to doing this with DialogueSystem?
Moving player towards NPC and automatically starting dialogue when NPC is clicked
Re: Moving player towards NPC and automatically starting dialogue when NPC is clicked
Hi,
Since the player could possibly click somewhere else while the PC is moving, it would be best to handle this outside of the Dialogue System. Only involve the Dialogue System when the player gets close to the NPC and the NPC was the last thing clicked. At that point, call DialogueManager.StartConversation() to start the conversation, or if you want to use a Dialogue System Trigger call the Dialogue System Trigger's OnUse() method.
Since the player could possibly click somewhere else while the PC is moving, it would be best to handle this outside of the Dialogue System. Only involve the Dialogue System when the player gets close to the NPC and the NPC was the last thing clicked. At that point, call DialogueManager.StartConversation() to start the conversation, or if you want to use a Dialogue System Trigger call the Dialogue System Trigger's OnUse() method.