Animation not Playing

I’m not sure if this is the right subcategory to post this in, but I made an animation to be played when a player activates a proximity prompt and my issue is simply that the animation is not playing. I am using prints to debug and it still prints after the animation should be played, even though the animation doesn’t play.
I have already changed the priority, and my game as well as the animation are both in R6. I tried replacing the animation I just made with a previous animation I made that worked in a different game of mine, of which I also tried the exact same code to make the animation play and it still didn’t work with a different animation or the same code.
I have looked for other posts on this same issue, and I have found and looked through many, but the solutions and tips in those posts did not work for me. I’m not sure if it’s an issue with my game, the avatar settings, (since they changed them to be a bit more complicated to me, but I’m pretty sure anyways it is set to R6), or my code trying to play the animation.

Here is my script:

local proxPrompt = script.Parent
local tapsStorage = game.ServerStorage.Taps
local anim = script.Animation

proxPrompt.Triggered:Connect(function(plr)
	local tap = tapsStorage:FindFirstChild(plr.EquippedGears.Tap.Value):Clone()
	if tap then
		local animator = plr.Character.Humanoid.Animator
		local track = animator:LoadAnimation(anim)
		track:Play()
		print("should've worked")
		plr.Character.Humanoid.WalkSpeed = 0
		plr.Character.Humanoid.JumpHeight = 0
		proxPrompt.Enabled = false
		local anchorPoint = script.Parent.Parent
		tap.Parent = workspace
		tap.PrimaryPart.CFrame = (anchorPoint.CFrame * CFrame.new(Vector3.new(-1.35,0,0)))
	end
end)

If anyone can help it would be greatly appreciated!

2 Likes

Did you upload the animation to the owner of the game (either you or the group the game may be in). if thats fine then maybe try waiting for the Animator?

local animator = plr.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
1 Like

Could be the issue

He mentioned that his debug print statements were working fine, so the animator must have been found otherwise it would yield an error something along the lines of Attempt to index nil with ":LoadAnimation".

Alright i ran that script except for the “Tap” stuff, and it worked correctly.

I know you said you did set priority but just double check its set to action4 atleast temporarily, that will override all the other animations so if it works you know its getting interrupted by something

Also make sure the animation is uploaded and owned by your account or group aswell

other things that might be causing it, it could be when you are setting the cframe of things, but i doubt its that since its a cloned object you are doing that to.

It is uploaded and owned by my account and I already tried setting the priority to Action4 and it still didn’t work.

It is uploaded by me, and the other animations I tested with as well are uploaded by me as well.

Turns out, it was something with the game. I checked the new avatar settings that it had automatically applied to my other game where I tested if the animation worked (and it did), and I realized there’s a hidden setting that I had to switch to R6 from R15, even when I already switched a different setting that made my avatar R6.

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