Animation wont play

so im trying to play an animation, the if statements work, it prints “animation starting” right before it starts, but it doesn’t do anything?

local UserInputService = game:GetService("UserInputService")

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()

local Mouse = Player:GetMouse()
local NewAnimation = Instance.new("Animation")
NewAnimation.AnimationId = "rbxassetid://15476177732"
NewAnimation.Parent = Character

UserInputService.InputBegan:Connect(function(Input)
	
	if Input.UserInputType == Enum.UserInputType.MouseButton1 then
		
		local Pickaxe = Character:FindFirstChild("Pickaxe")
		
		print("Pickaxe: " .. tostring(Pickaxe))
		
		if Pickaxe then
			
			print("animation starting")
			
			local Humanoid = Character:FindFirstChild("Humanoid")
			local Animation = Humanoid:LoadAnimation(NewAnimation)
			print(Animation)
			
			Animation:Play()
		end
	end
end)
1 Like

When you created the animation, which animation priority did you use?

1 Like

animation priority? i dont see it in the animation instance, and i dont know what that is

1 Like

When making an animation using Animation editor, you can set a animation priority. If you didn’t set it to Action1/2/3/4, it won’t play over default animations.

ohhhhhhhhhhhhhhh ty, but is there a way to edit an already existing animation instead of making a third one? ._.

Yeah, click “Import from roblox” from this menu, it will give you a list of your animations. Then you can edit it and save it again without making a new one.

1 Like

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