Make character walk in sequence

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
aya
Posts: 3
Joined: Tue Mar 06, 2018 10:59 pm

Make character walk in sequence

Post by aya »

Hello,

I want to make a character move during a sequence and play the walking animation. I could only find the code below but I don't want speed to increase up from 0 to 2 in 3 seconds, but stay at speed 2 for 3 seconds but I cannot figure out how to do that. Any ideas? Thank you

Code: Select all

AnimatorFloat(Speed,2,speaker,3)@0;
User avatar
Tony Li
Posts: 22059
Joined: Thu Jul 18, 2013 1:27 pm

Re: Make character walk in sequence

Post by Tony Li »

Try this:

Code: Select all

AnimatorFloat(Speed, 2, speaker);
AnimatorFloat(Speed, 0, speaker)@3
At the 0-second mark (i.e., the beginning), it will set Speed to 2.

At the 3-second mark, it will set Speed to 0.

The default subject is 'speaker', so you can shorten it to:

Code: Select all

AnimatorFloat(Speed, 2);
AnimatorFloat(Speed, 0)@3
Post Reply