You don’t need to create your own animations and play them in accordance with the HumanoidStateType
. Just replace the default animations.
local Players = game:GetService("Players")
local function onCharacterAdded(character)
-- Get animator on humanoid
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
-- Stop all animation tracks
for _, playingTrack in pairs(animator:GetPlayingAnimationTracks()) do
playingTrack:Stop(0)
end
local animateScript = character:WaitForChild("Animate")
--animateScript.run.RunAnim.AnimationId = "rbxassetid://"
--animateScript.walk.WalkAnim.AnimationId = "rbxassetid://"
--animateScript.jump.JumpAnim.AnimationId = "rbxassetid://"
--animateScript.idle.Animation1.AnimationId = "rbxassetid://"
--animateScript.idle.Animation2.AnimationId = "rbxassetid://"
--animateScript.fall.FallAnim.AnimationId = "rbxassetid://"
--animateScript.swim.Swim.AnimationId = "rbxassetid://"
--animateScript.swimidle.SwimIdle.AnimationId = "rbxassetid://"
--animateScript.climb.ClimbAnim.AnimationId = "rbxassetid://"
end
local function onPlayerAdded(player)
player.CharacterAppearanceLoaded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)
Or copy the default animate script, modify the animations ids in animValues
and then replace the default one with it.