Making the UI follow the NPC

Announcements, support questions, and discussion for the Dialogue System.
Smugz
Posts: 12
Joined: Mon Jan 04, 2021 10:05 pm

Re: Making the UI follow the NPC

Post by Smugz »

So I didn't add the lua component to the dialogue manager, after testing it again it now seems to work (sort of), basically the NPC seems to only switch to stationary when they reach their waypoint, until they reach it they keep walking and then because of that they also refuse to turn around. Is there anyway to make the switch to stationary immediately?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making the UI follow the NPC

Post by Tony Li »

Try using SetEmeraldDestination() first to change the destination point to the NPC's own position (i.e., stop).
Smugz
Posts: 12
Joined: Mon Jan 04, 2021 10:05 pm

Re: Making the UI follow the NPC

Post by Smugz »

hi, so this is my lua code, sadly it did not work, no errors:

Code: Select all

SetEmeraldDestination("go=Stark", "stop");
SetEmeraldBehavior("go=Stark", "passive");
SetEmeraldWander("go=Stark", "stationary")
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making the UI follow the NPC

Post by Tony Li »

That seems to work for me. Are there any errors or warnings in the Console window?

You can try adding a slight delay to the LookAt() sequencer command to allow the AI to come to a stop first:

Code: Select all

LookAt(listener)@0.5
Here's a simple example scene:

DS_TestEmeraldAIFacePlayer_2021-01-15.unitypackage

Walk north (up) and right-click on the NPC named "XXX".
Post Reply