Animation walkspeed problem

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    i wan’t a custom running animation

  2. What is the issue? Include screenshots / videos if possible!
    running animation got way too fast as walkspeed got faster.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    no solutions related to this…
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

here’s the script i’m using:

local animateScript = character:WaitForChild("Animate")
animateScript.run.RunAnim.AnimationId = runAnimationId

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

help is appreciated!

1 Like

How many total frames does your animation have?

1 Like

Are you able to show us the animation itself?

1 Like

i put the animation in the post.

it give’s me this error:

AnimationSpeed is not a valid member of Animator "Workspace.yousef_mash1.Humanoid.Animator" 

i only used this:

local function updateAnimationSpeed(humanoid,animator)
	local walkSpeed = humanoid.WalkSpeed
	local animationSpeed = walkSpeed / 16 
	--16 is the adjustment factor. It may need tweaking
	--may want to try and stick with multiples, added 4 added 8 added 16  
	animator.AnimationSpeed = animationSpeed
end

local animator = humanoid:WaitForChild("Animator")
		updateAnimationSpeed(humanoid,animator)

I don’t seem to be on the right track here … I’m sorry.

How did you get that to act like that in the 1st place … is that a very small player?
If it is … that should be about … WalkSpeed=4.8 … guessing by how fast the video is moving.
Either way lowing the WalkSpeed is what it looks like needs to be changed.

default walk speed is 16 … 1/2 the player size is would be 8 … 1/4 would be 4 … kind of like that.

1 Like

Yo,
You can just change the speed of an animation by
Animation:AdjustSpeed(CurrentWalkspeed/16)
I’m guessing you changed the id the animate script in your character

Change the speed of an animation - Help and Feedback / Scripting Support - Developer Forum | Roblox

1 Like

I went with that at 1st … but really don’t know what he is working with …
Time for me to pass and walk away …

1 Like

the problem is that i can’t use AdjustSpeed when you change the animationId for roblox default animations, so how do people do it?

The animator instance is only meant for loading animation tracks and you don’t need to use WaitForChild for the animator global variable and instead use FindFirstChildOfClass(“Animator”) cause WaitForChild function yeilds the script for a mili second and only is used for instances that are loading.

The only time you can change the animation track is when you get the animation variable and then change the speed after by using (AnimationTrack:AdjustSpeed(number))

Example:

local player = game:GetService(“Players”).LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:FindFirstChildOfClass(“Humanoid”)
local animator = character:FindFirstChildOfClass(“Animator”)

local AnimationTrack = animator:LoadAnimation(script:WaitForChild(“AnimationTrack”))
AnimationTrack:Play() – You can adjust speed after the animation has been loaded
AnimationTrack:AdjustSpeed(1) :Number

Another note: is that the whole script? where is the part where you load the animation in via script?

the problem is that this is not an animation track, its overriding roblox default running animation with an animateScript:

local animateScript = character:WaitForChild("Animate")
animateScript.run.RunAnim.AnimationId = runAnimationId

meaning this already loaded, where and how do i put AdjustSpeed like this?
lets say you can’t adjust the speed of the animateScript, is there any reliable to detect if the player move’s or stops so i can instead load runanimationid and play it/stop it and use the AdjustSpeed method on it?

I see what you’re doing now. The only way to change speed without loading it in the script. You would have to use GetPlayingAnimationTracks() in the animator to loop every animation that is currently playing in the character.

The animation.Length condition is only meant for it to fully load to enable, so we can change the speed without error!

Example:

It’s a local script located in the StarterCharacter Scripts.

It should only be event driven so we don’t need to be using while true do loops.

You also could use the games StartPlayer CharacterWalkSpeed instead of the players current WalkSpeed!

Hope this helps!

Screenshot 2024-06-21 123734


This also applies to R15 rig animations but it won’t really work if you use R15 strafing animations setting on

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.