Idle animation and walk animation twitchy

Im using custom characters in my game which means they need custom idle and walk animations, however when inpractice, the animations are really twitchy and sometimes even t-pose (not in video)

Animate script


local run = game.ReplicatedStorage.Remotes.Run
local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local Idle = Instance.new("Animation")
local db = false
Idle.AnimationId = "rbxassetid://13779417516"

local Walk = Instance.new("Animation")
Walk.AnimationId = "rbxassetid://14176814119"

repeat task.wait() until script:FindFirstChildWhichIsA("Animation")

local idleAnim = script.Parent.Humanoid.Animator:LoadAnimation(Idle)
idleAnim.Looped = true
idleAnim.Priority = Enum.AnimationPriority.Idle
local runAnim = script.Parent.Humanoid.Animator:LoadAnimation(Walk)
runAnim.Looped = true
runAnim.Priority = Enum.AnimationPriority.Movement
local jumpAnim = script.Parent.Humanoid.Animator:LoadAnimation(Idle)
jumpAnim.Looped = true
jumpAnim.Priority = Enum.AnimationPriority.Idle
local climbAnim = script.Parent.Humanoid.Animator:LoadAnimation(Walk)
climbAnim.Looped = true
climbAnim.Priority = Enum.AnimationPriority.Movement
local fallAnim = script.Parent.Humanoid.Animator:LoadAnimation(Idle)
fallAnim.Looped = true
fallAnim.Priority = Enum.AnimationPriority.Idle
local swimAnim = script.Parent.Humanoid.Animator:LoadAnimation(Walk)
swimAnim.Looped = true
swimAnim.Priority = Enum.AnimationPriority.Movement
local sitAnim = script.Parent.Humanoid.Animator:LoadAnimation(Idle)
sitAnim.Looped = true
sitAnim.Priority = Enum.AnimationPriority.Idle
local coreAnim = script.Parent.Humanoid.Animator:LoadAnimation(Idle)
coreAnim.Looped = true
coreAnim.Priority = Enum.AnimationPriority.Core

game["Run Service"].Heartbeat:Connect(function()
	if script.Parent.HumanoidRootPart.Velocity.Magnitude > 0.1 then
		if script.Parent.Humanoid:GetState() == Enum.HumanoidStateType.Dead then
			for _, i in script.Parent.Humanoid:GetPlayingAnimationTracks() do
				i:Stop()
			end
		elseif script.Parent.Humanoid:GetState() == Enum.HumanoidStateType.Seated then
			if not sitAnim.IsPlaying then
				
				run:FireServer(Walk)	
			end
		elseif script.Parent.Humanoid:GetState() == Enum.HumanoidStateType.Jumping then
			if not jumpAnim.IsPlaying then
				
				run:FireServer(Walk)
			end
		elseif script.Parent.Humanoid:GetState() == Enum.HumanoidStateType.Climbing then
			if not climbAnim.IsPlaying then
			
				run:FireServer(Walk)
			end
		elseif script.Parent.Humanoid:GetState() == Enum.HumanoidStateType.Freefall then
			if not fallAnim.IsPlaying then
				
				run:FireServer(Walk)
			end
		elseif script.Parent.Humanoid:GetState() == Enum.HumanoidStateType.Swimming then
			if not swimAnim.IsPlaying then
				
				run:FireServer(Walk)
			end
		elseif script.Parent.Humanoid:GetState() == Enum.HumanoidStateType.Running then
			if not runAnim.IsPlaying then
				repeat
					runAnim:Play()
					wait(1.2)
				until script.Parent.HumanoidRootPart.Velocity.Magnitude < 0.1 

				
				
			
				print("fired")
				db = false
			end
		end
	else
		for _, i in script.Parent.Humanoid:GetPlayingAnimationTracks() do
			if i.Name ~= "Idle" then
				i:Stop()
				
			end
		end
		if not idleAnim.IsPlaying then
	
			idleAnim:Play()
			
			
		end
	end

	end)
1 Like

Try using Roblox’s Animate script which can be found and copied at runtime?

2 Likes

I don’t think you really need a custom animate script since I’ve worked with custom rigs all the time and they use the default animate script

2 Likes


when i use the roblox animate script, it works at first but then the animation freezes and the walk animation is super stiff

2 Likes

Is the walking animation looped?

1 Like

Loop it using the Animation Editor

2 Likes

how would i fix the stiffness of the animation

2 Likes

What do you mean by stiffness.

2 Likes


there is almost no stride, you can see the intended stride in the first clip

1 Like

Make the animations more fluid, this is not a scripting related question

1 Like

the animation is fluid

1 Like

Great, now loop it, publish, and playtest.

2 Likes

sorry to ask since its not really script related but how would you loop it from the editor

1 Like

The last button where you play the animation from is the loop button. Hover over them and see their description

2 Likes

alright, thank you, ill go play test it once i fix everything up

1 Like

tysm for helping, the animation is so much better now

2 Likes

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