Page 1 of 1

Moving player towards NPC and automatically starting dialogue when NPC is clicked

Posted: Sat Aug 01, 2020 8:15 pm
by jlhacode
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?

Re: Moving player towards NPC and automatically starting dialogue when NPC is clicked

Posted: Sat Aug 01, 2020 8:33 pm
by Tony Li
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.