The animation wont play for some reason

local tool = script.Parent

local id = "rbxassetid://97572223426399"
local yumheartanim = tool:WaitForChild("yumheart")
yumheartanim.AnimationId = id

local heartremotevent = game:WaitForChild("ReplicatedStorage"):WaitForChild("HeartRemoteEvent")

tool.Activated:Connect(function()
	local character = tool.Parent
	local player = game.Players:GetPlayerFromCharacter(character)
	
	local animator = character:WaitForChild("Humanoid"):WaitForChild("Animator")
	local yumheartanimtrack = animator:LoadAnimation(yumheartanim)
	yumheartanimtrack:Play()
	print("yo animatioon")
	if yumheartanimtrack.IsPlaying then
		print("it is playing!")
	end
	
	if player then
		local playerhearts = player:FindFirstChild("Hearts")
		
		if playerhearts.Value == 3 then
			return
		else
			playerhearts.Value += 1
			heartremotevent:FireClient(player, playerhearts, "HeartPlus")
			--tool:Destroy()
		end
	end
end)

so as the title says the animation wont play, i dont know why i added prints they print so it means that it works, but i dont see nothing


it has keyframes
what can i do? any help is greatly appreciated! (btw the animation is set to action3)

1 Like

do the animation rigs and the player character rig types match up? I once had an issue where I set the player’s to R6 Animations, which apparently aren’t R6.

Hope this helps

2 Likes

yeah, when i replay the animation in the blender plugin it shows every frame, i dont know if that can be the problem

1 Like

i tried using a local script but it still wont work, what can i do?

i found out i was playing in r15 instead of r6, even tho i remember setting it to r6, thank you for helping me!

1 Like

you’re welcome!
hope all goes well!

1 Like