Making characters move with sequences

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
AlexNerd
Posts: 39
Joined: Sat Jun 29, 2019 11:46 am

Making characters move with sequences

Post by AlexNerd »

Is there any way to make a character move with sequence commands other then using AICharacterControl (I want to make a character move but I don't want to use the default Third Person Controller)?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making characters move with sequences

Post by Tony Li »

Hi Alex,

It depends on what you mean by "move". If you want to move a GameObject from its current position to a new position X over 3 seconds, you can use the MoveTo() sequencer command:

Code: Select all

MoveTo(X, MyCharacter, 3)
where "X" is the name of a GameObject (typically an empty one) and "MyCharacter" is the name of the character you want to move. This must translates the GameObject's position.

If you want to make the character face the same direction as X, you can add in the LookAt() sequencer command:

Code: Select all

MoveTo(X, MyCharacter, 3);
LookAt(X, MyCharacter, 3)
This rotates MyCharacter to look at X over 3 seconds.


And if you want to play an animation state while the character is moving:

Code: Select all

AnimatorPlay(Walk, MyCharacter);
MoveTo(X, MyCharacter, 3)->Message(Arrived);
LookAt(X, MyCharacter, 3);
AnimatorPlay(Idle, MyCharacter)@Message(Arrived)
Post Reply