Page 1 of 1

Making characters move with sequences

Posted: Fri Mar 06, 2020 7:11 pm
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)?

Re: Making characters move with sequences

Posted: Fri Mar 06, 2020 9:21 pm
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)