Animation not playing

I’ve ran into this issue before, you have to use FindFirstChildWhichIsA() instead of FindFirstChildOfClass() because FindFirstChildOfClass() doesn’t include inheritance. Animator is an inherited class from Instance, so you will need to include inheritance.

Also, you don’t have to specify the find method, if you know that you’re looking for “Humanoid”. You can use type check to identify the instance as the class:

script.Parent.Touched:Connect(function(hit)
    local ExampleVariableName:Humanoid = hit.Parent:FindFirstChild("Humanoid")
end)

This will give you the same intellisense as FindFirstChildWhichIsA(), but to each their own. This is particularly helpful when you’re identifying function parameters:

-- Just an example of how this would work.
local GetPlayerFromPart = function(RayData:RaycastResult)
    return game.Players:GetPlayerFromCharacter(RayData.Instance.Parent)
end

ok so basically, I should replace FindFirstChildOfClass("Animator") with FindFirstChildWhichIsA("Animator") ?

Yes, that will fix your issue with the script. You can do this with Humanoid as well.

no it’s not in tool it’s in a local script inside player gui, and also the code works but when i change the animation id to a different animation, it doesn’t work.

how would I go about “debugging” an animation? I only know how to debug codes, but this time the code is working but the animation is not…

1 Like

can u show me all ur code with userinputservice?

Just to clarify, the animation works properly when I used an animation I made a month ago, but does not work with the animation I made today. These are the difference and similarities between the two:

Similarities:
I am the owner
It’s put in the same game (and made in the same game)

Differences:

Old animation:
Id = 12495659836
Only rotates right arm
Created a month ago
Priority = Action

New animation:
Id = 13023893909
Moves Head, both arms, both legs, and HumanoidRootPart
Crated today
Priority = Action

Note that I did not run those together (don’t be confused by the priority), instead I ran them separately, the old one works, the new one doesn’t. Pelase help.

Like I said before, check the animation priority, looped or not and etc.
Now, try to make a new animetion and play it. If the problem still persist, try reporting it to Roblox.

the code isn’t the problem because the old animation id works but the new animation id doesn’t work

how do I check the looped of the animation?

1 Like

image
If the button is white, it mean the animation is not looped
If the button is blue, it mean the animation is looped. If an animation with priority of 2 and looped play, any animation that have lower priority than it will not animate / not play.

ohhh, and the looped property is also saved during exporting? (publish to roblox button)

1 Like

Indeed. That might be the reason that your animation doesn’t play. Perhaps, an Idle animation with looped enabled and high priority can’t be override by an animation with lower priority.

What is the default idle animation priority? Because the only animations i’ve ever uploaded to roblox are those two animations only, and they aren’t played together

I used animation.Ended event, animation.IsPlaying, and they are all working properly. What could be the problem here?

Another similarity is that they are both played from the client, using humand.Animator:LoadAnimation()

Hey guys I just realized that I can’t upload my older animation (which works) to animation editor, but I can upload my newer animation (which does not work) to animation editor. Is it because Roblox needs to take time to moderate my animation?

Guys I solved this issue! All I did was to create a new animation that uses R15 because my character is R15. I know this is stupid, my old animation was made with R6 and it still works, but my new animation, made in R6 would not work on my R15 character. While looking for a solution, I saw lots of other people who can’t play animations, so if you are reading this and have a similar problem, just create a new animation that matches your character type. Thanks for all your time! @GFXBIT, @dark_friend20, and @umamidayo

1 Like

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