Hi,
It looks like the problem is that the NPC isn't facing the direction that he is moving. To fix this, use the LookAt() sequencer command to make him face his destination. For example:
Code: Select all
AnimatorPlay(Stand)@10;
AnimatorPlay(Walk)@11;
LookAt(Point B,,0.5)@11;
MoveTo(Point B,,1)@11;
AnimatorPlay(Dance)@12;
AnimatorPlay(Walk)@14;
LookAt(Point A,,0.5)@14;
MoveTo(Point A,,1)@14;
AnimatorPlay(Idle)@15
(I added LookAt() commands.)
Sequences can be more sophisticated, too. "
How To Write Sequences" explains different ways that you can write sequencer commands. For example, here is another way to handle the timing:
Code: Select all
Delay(10)->Message(Ready);
AnimatorPlayWait(Stand)@Message(Ready)->Message(Stood);
AnimatorPlay(Walk)@Message(Stood);
LookAt(Point B,,0.5)@Message(Stood);
MoveTo(Point B,,1)@Message(Stood)->Message(Arrived_B);
AnimatorPlayWait(Dance)@Message(Arrived_B)->Message(Danced);
AnimatorPlay(Walk)@Message(Danced);
LookAt(Point A,,0.5)@Message(Danced);
MoveTo(Point A,,1)@Message(Danced)->Message(Arrived_A);
AnimatorPlay(Idle)@Message(Arrived_A)
This may look more complicated, but it takes care of the timing so you don't have to figure out how long each animation clip is.
If you want to control the NPC's movement through a controller script, you can write a
custom sequencer command. For example, say you write a custom sequencer command called NavigateTo(). Then you could use a sequence like this:
Code: Select all
AnimatorPlay(Stand)@10;
NavigateTo(Point B)->Message(Arrived_B);
AnimatorPlayWait(Dance)@Message(Arrived_B)->Message(Danced);
NavigateTo(Point A)@Message(Danced)->Message(Arrived_A);
AnimatorPlay(Idle)@Message(Arrived_A)
If these get too long and complicated, you can use an interactive editor like Timeline or SLATE. Then your Sequence field can just be, for example:
But of course this means you must also use an additional tool such as Timeline or SLATE.