HeroEngine Forums

HeroEngine Support => Scripting & Programming => Topic started by: Legacy on May 03, 12, 08:36:27 AM

Title: [Resolved] Animation speed fknob?
Post by: Legacy on May 03, 12, 08:36:27 AM
Hello,
I would like to have some animations in my game, whose playback speed I'd like to change dynamically based on circumstances. An example might be given of an attack animation that would play slowly when the character is a newbie and get faster as he levels up. Or anything of this kind, reallt. However, I found that the animation sequence cannot have its speed input based on a fknob, only numerical value is acceptable.

Is there really no way to dynamically set animation speed?
Thanks
Title: Re: Animation speed fknob?
Post by: HE-JAY on May 03, 12, 10:43:20 AM
Code: [Select]
SetAnimFloatKnob(mychar,"Speed",resultspeed)

A more in-depth example can be found in the FPS Demo world (specifically, the FPS_ACCControllerClassMethods script); note that you need to take into account the fact that this will increase the speed of 'all' animations on the character, so this is more appropriate for an overall haste effect than a speed change to a single composite animation.
Title: Re: Animation speed fknob?
Post by: Legacy on May 03, 12, 12:13:00 PM
Cannot connect to FPSRef right now it appears to be down, but do I understand it correctly that the "Speed" fknob is somehow built-in into the animation engine?
Title: Re: Animation speed fknob?
Post by: HE-JAY on May 03, 12, 12:50:21 PM
That is correct (: All agents in the animation system have a float knob named "Speed", and this knob is interpreted under the hood as a 'speed factor' for animation playback.
Title: Re: Animation speed fknob?
Post by: Legacy on May 03, 12, 12:57:56 PM
That is correct (: All agents in the animation system have a float knob named "Speed", and this knob is interpreted under the hood as a 'speed factor' for animation playback.

Right, thanks for clarification, Jay!