Changing the speed of an animation with DS

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Changing the speed of an animation with DS

Post by lostmushroom »

I've been reading the documentation on using DS with the animator but haven't found quite what I'm looking for. Is there a way to change the speed of an animation that's currently playing using the sequence field?

I have a scrolling background that sometimes needs to be "paused". So I'm wondering if there's a way to set the speed to 0 in one dialogue node, then back to 1 in the next.
User avatar
Tony Li
Posts: 22161
Joined: Thu Jul 18, 2013 1:27 pm

Re: Changing the speed of an animation with DS

Post by Tony Li »

Hi,

You could use a blend tree for the scrolling background animator state. Blend on a float parameter, where 0 is stopped and 1 is scrolling:

scrollSpeed.png
scrollSpeed.png (43.75 KiB) Viewed 300 times

Then use the AnimatorFloat() sequencer command to set the float parameter.
lostmushroom
Posts: 195
Joined: Mon Jul 01, 2019 1:21 pm

Re: Changing the speed of an animation with DS

Post by lostmushroom »

I totally forgot Blend Trees were a thing. Thanks Tony!
User avatar
Tony Li
Posts: 22161
Joined: Thu Jul 18, 2013 1:27 pm

Re: Changing the speed of an animation with DS

Post by Tony Li »

Glad to help! :-)
Post Reply