Page 1 of 1

Make character walk in sequence

Posted: Wed Mar 07, 2018 6:48 am
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;

Re: Make character walk in sequence

Posted: Wed Mar 07, 2018 8:52 am
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