[SOLVED] Animation is bugging out

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 wanted to play around with custom run and walk animations but I encountered this weird issue. Also I made the custom walk animation by forking the Animate script from the player’s character and replacing the walk animation’s AnimationId for my custom one.

  1. What is the issue? Include screenshots / videos if possible!

As you can see in the video below when starting the run animation or ending the animation the avatar’s arms begin to sometimes bug out.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I have looked on the devforum but I didnt find a solution to a problem like this.

Here’s the script responsible for playing the run animation:

local TweenService = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")

local currentCamera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local humanoid = character:WaitForChild("Humanoid")

local Anim = Instance.new("Animation")
Anim.AnimationId = "rbxassetid://11734934044"

local LoadedAnim = humanoid:WaitForChild("Animator"):LoadAnimation(Anim)
LoadedAnim.Priority = Enum.AnimationPriority.Movement

local sprintSpeed = {
	
	["A"] = {
		
		WalkSpeed = 50
		
	},
	["B"] = {
		
		WalkSpeed = 16,
		
	}
}

local FOVgoal = {
	
	["A"] = {
		
		FieldOfView = 90
		
	},
	["B"] = {
		
		FieldOfView = 70
		
	}
	

}

local TI = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)


UIS.InputBegan:Connect(function(input, gameprocess)
	
	if not gameprocess then
		
		if input.KeyCode == Enum.KeyCode.LeftShift and humanoid.MoveDirection.Magnitude > 0 then
			
			local SpeedTween = TweenService:Create(humanoid, TI, sprintSpeed["A"]):Play()
			local FOVtween = TweenService:Create(currentCamera, TI, FOVgoal["A"]):Play()
			
			LoadedAnim:Play(1)
			
		end
		
	end
	
end)

UIS.InputEnded:Connect(function(input, gameprocess)

	if not gameprocess then

		if input.KeyCode == Enum.KeyCode.LeftShift then

			local SpeedTween = TweenService:Create(humanoid, TI, sprintSpeed["B"]):Play()
			local FOVtween = TweenService:Create(currentCamera, TI, FOVgoal["B"]):Play()
			
			LoadedAnim:Stop(0.5)
			
		end

	end

end)
1 Like

Nothing wrong with your script, just animation blending “fix”.
I read that if you add this attribute in workspace:

RbxLegacyAnimationBlending

and set it to true, it will probably fix your problem. If it doesnt, make sure your animation priorities are good. The new “fix” blends animations that are the same priority.

I just did what you told me and it didn’t work, also the animations are not the same priority since the walk animation is Core priority and the run animation is Movement.

Use walk animation as movement. Dont use core because core is what priority the original roblox animations are. NEVER use core unless you did something with the game that changed the “roblox original animations thingy”

I understand however I have no idea how would i change that since the walk animation is by default being set to Core because I forked the roblox Animate script and i can’t change the priority in the script without breaking roblox animations.

Why dont you just change the priority in the animation, then? just import it into animator, change the priority, and export it? or did you already try that?

It would not work because I replaced the default roblox walk animation with my custom one and the Animate script sets the animations to Core priority automatically. So it does not matter what priority it would be exported as.


This is the forked script and the replaced animation.

Yep, looks like the normal animate script to me.
But, based on your problems, I dont think theres a way for me to help except for you going into the animate script and changing stuff.

Maybe try finding a line that switches the priority, and try and delete it?
All you need to know is that, the script you made is fine, and you shouldnt change it.

Ok thanks, I’ll try to modify the Animate script and see what I can do.

I don’t think I can do anything about the bug. I’ll just try doing the animations some other way.

I found a solution. It turns out that the fadeTime thing in :Play() and :Stop() is causing those bugs and decreasing it fixed everything.

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