AnimationTrack:AdjustSpeed() not working as intended

I went searching for help on AnimationTrack:AdjustSpeed() and found this in the manual:

Playing Animation for a Specific Duration

The following function will play an AnimationTrack for a specific duration. This is done by changing the speed of the animation to the length of the animation divided by the desired playback duration. This could be used in situations where a developer wants to play a standard animation for different duration (for example, recharging different abilities).

function playAnimationForDuration(animationTrack, duration)
local speed = animationTrack.Length / duration

I wanted to point out that this doesn’t work. and the solution presented within this topic, does.

so the code presented above isn’t functional
Describe the bug. Describe what is happening when the bug occurs. Describe what you would normally expect to occur.

I would normally expect it to play at a desired length of time

How often does the bug happen (Everytime/sometimes/rarely)? What are the steps that reproduce the bug? Please list them in very high detail. Provide simple example places that exhibit the bug and provide description of what you believe should be the behavior.

It doesn’t work everytime.

--this works:
animationTrack:AdjustSpeed(1.5) -- takes half as long

--Where this doesn't:
animationTrack:AdjustSpeed(1.5) -- doesn't work

Here is an example of how it does work (I couldn’t get it to format, sorry):

function do()
local attack = humanoid:LoadAnimation(script.Animation)
attack:AdjustSpeed(0.5) – where it should be half the time it usually is

And this just stalls the animation:

function do()
local attack = humanoid:LoadAnimation(script.Animation)
attack:AdjustSpeed(attack.Length / 0.5) – where I’d want the animation to be very quick

Where does the bug happen (www, gametest, etc) Is it level-specific? Is it game specific? Please post a link to the place that exhibits the issue.

tested it on the client, but this would presumably be a server thing too.

Would a screenshot or video help describe it to someone? If so, post one.

Not really, Sorry.

For graphics bugs, it is sometimes helpful to know your system specs, especially graphics card.

Windows 10
Intel G3240 3.10 GHz x64
Geforce GT730

When did the bug start happening? If we can tie it to a specific release that helps us figure out what we broke.

Not sure. Sorry.

Anything else that you would want to know about the bug if it were your job to find and fix it.

The information I provided is hopefully enough to fix the issue outlined.

Thank you for your time!
Aka: Paradigm_Dinosaurs


This topic was automatically closed after 1 minute. New replies are no longer allowed.