Animation FadeTime not doing anything

Hello! I’m animating a cutscene, and need animations to stop and start instantly between cuts, but that doesn’t happen. I’ve tried setting the keyframes at the end or start of an animation to Constant EasingStyle, stopping animations with :Stop(0) and playing with :Play(0), but nothing’s working. How do I instantly stop an animation, and return to a neutral pose?

Hello!

-- assuming you already have an animator
local animator = script.Parent:WaitForChild("Animator")

-- stop all animations
for _, track in pairs(animator:GetPlayingAnimationTracks()) do
    track:Stop()
end

-- play neutral pose animation
local neutralPose = Instance.new("Animation")
neutralPose.AnimationId = "rbxassetid://animation_id_here" -- replace with your neutral pose animation id

local neutralTrack = animator:LoadAnimation(neutralPose)
neutralTrack:Play()

Here’s what this script does:

  1. It stops all the currently playing animations.
  2. It then loads and plays a “neutral pose” animation.

To stop an animation instantly and return to a neutral pose, you should create an animation that has the character in the neutral pose you want. When you want to stop the animation and return to the neutral pose, you can stop the current animation and play the neutral pose animation.

replace "rbxassetid://animation_id_here" with the asset ID of your neutral pose animation.

Remember, smooth transitions between animations are often desirable for a polished look, but in certain scenarios like quick cuts in a cutscene, you may want to override this behavior for more abrupt changes. You may still have to adjust the timings in your animations and your script to get things looking exactly how you want them.

Let me know if you have any other questions!

1 Like

Hello, thank you for your reply!

I have tried this before, and when I saw your reply I tested it again, but the problem persists.

When I position my rig, I stop the animations with this code -

for i, anim in pairs(rig.Humanoid:GetPlayingAnimationTracks()) do
	if anim.Animation.Parent.Name == "Action" then
		anim:Stop(0)
	end
end

Playing the neutral pose afterwards doesn’t change anything, as the problem is the fadeTime between animations not doing what it’s supposed to, no matter if I leave it blank or add a 0 - :play() vs :play(0) - as it doesn’t affect anything.

Here’s a video of the behaviour -

As you can see, right as the camera cuts the character spins around. This is not in the original animation and is the last animation fading out. How would I stop THIS behaviour?

Also, I’m still using :play(0) and :stop(0), no effect

I think I found a workaround, so I’m marking this as complete now :slight_smile:

It would help people, including me, if you listed what your solution was instead of just saying you found a solution. If your workaround is RbxLegacyAnimationBlending, I would find a different solution.

2 Likes

No it was an internal code issue.

I realised that as I played the next animation after the current one was stopped, then I couldn’t stop it (as it would be already stopped). So I just added a bit of extra allowance time into the animation and used a manual setup to determine when the animation was done.

So when it reaches a keyframe called “Stopped” now, that is when it moves on

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