Page 2 of 2

Re: Making the UI follow the NPC

Posted: Thu Jan 14, 2021 10:48 am
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?

Re: Making the UI follow the NPC

Posted: Thu Jan 14, 2021 1:50 pm
by Tony Li
Try using SetEmeraldDestination() first to change the destination point to the NPC's own position (i.e., stop).

Re: Making the UI follow the NPC

Posted: Fri Jan 15, 2021 5:11 am
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")

Re: Making the UI follow the NPC

Posted: Fri Jan 15, 2021 9:06 am
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".