My friend made an animation for the earthworm in my game, but whenever I play the animation, it plays incorrectly.
Here’s a video to demonstrate what happened:
The code I used to play the animation:
local AnimationInstance = Instance.new("Animation")
AnimationInstance.AnimationId = "rbxassetid://" -- I'm hiding the ID just incase
AnimationInstance.Parent = script
local Earthworm = script.Parent
local HumanoidRootPart = Earthworm:WaitForChild("HumanoidRootPart")
local Humanoid = Earthworm:FindFirstChildOfClass("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator")
local Animation = Animator:LoadAnimation(AnimationInstance)
Animation.Priority = Enum.AnimationPriority.Action
Animation.Looped = true
Animation:Play()
Any help would be much appreciated!