How do I make my own Animate script?

I’m having problems with the default animate script roblox gives you. How can I go about making my own? I have all animations ready. The problem or road block I hit was playing them correctly. Say the player is “Idle” play that animation or if they’re moving then do that walk animation, but I cant seem to get it to work properly. Thanks.

This is what I have at the moment:

local animationsFolder = script:WaitForChild("Animations")
local movementAnimationsFolder = animationsFolder:WaitForChild("Movement")

local character = script.Parent
local humanoid = character:FindFirstChildOfClass("Humanoid")
local player = game:GetService("Players"):GetPlayerFromCharacter(character)

local pose = ""
local currentAnimTrack = nil

function playAnimation(anim, transitionTime)
	currentAnimTrack = humanoid:LoadAnimation(anim)
	currentAnimTrack.Priority = Enum.AnimationPriority.Movement
	
	currentAnimTrack:Play(transitionTime)
end
playAnimation(movementAnimationsFolder.Idle)
1 Like

I’m not sure why you want to redo the entire default animation script. Have you tried this method of using your own animations?

If you have then it would be easier to troubleshoot that or modify the original than remake the entire script.

1 Like

Yes, that’s why I want to make a new one since it has a lot of problems using my animations, as well as adding more code to it.

2 Likes