How can I get animation on my character to start playing immediately?

I have a part and when you touch it, it changes your character animation. Basically there is a flaw in roblox’s animation system where the new animations will only play once you stop moving, then start moving again. I want to know if there is a trick or something I can do to fix this.

1 Like

Set the animation to top priority:

local Animation = script.Animation --path to animation object
local Humanoid = script.Humanoid --path to humanoid

local Track = Humanoid:LoadAnimation(Animation)
Track.Priority = Enum.AnimationPriority.Action

To get an animation to play without a fade in:


I think you might be talking about the default Animate script and switching out an animation?

You could probably either make some changes to the Animate script or possibly switch the Humanoid’s state out of running then back to running.

where do I put in the animation id?

Animation.AnimationId = "your animation id"

Yeah I still have no idea what you mean or how it will work. Here is the context of my script:

	if hit.Parent:FindFirstChild("Humanoid") ~= nil then
		hit.Parent.Animate.walk.WalkAnim.AnimationId = "rbxassetid://8137104876"
		hit.Parent.Animate.idle.Animation1.AnimationId = "rbxassetid://8137256167"
		hit.Parent.Animate.idle.Animation2.AnimationId = "rbxassetid://8137256167"
		hit.Parent.Humanoid.WalkSpeed = 6
		hit.Parent.Humanoid.JumpPower = 0

Why did you delete your post, I didn’t get to read it yet

This may be helpful:

I don’t want to change the default animation, the script I have only changes the animation when I touch a part. Also it says that is for testing purposes

I got it to work by setting the humanoid walkspeed to 0, waiting 1/10 of a second, then setting Humanoid walkspeed to normal. Here is the updated script:

local debounce = 0

	if hit.Parent:FindFirstChild("Humanoid") ~= nil and debounce == 0 then
		debounce = 1	
		hit.Parent.Humanoid.WalkSpeed = 0
		hit.Parent.Animate.walk.WalkAnim.AnimationId = ""
		hit.Parent.Animate.idle.Animation1.AnimationId = ""
		hit.Parent.Animate.idle.Animation2.AnimationId = ""
		hit.Parent.Humanoid.JumpPower = 0
		hit.Parent.Humanoid.WalkSpeed = 6
		debounce = 0

It is almost unnoticeable in the game, so I will use this every time when changing animations, as it seems like the easiest method.

1 Like