Hello! So I made a custom idle animation that I made on a custom npc rig and every time I try to play it, it doesn’t work. I have tried with multiple other animations and it hasnt worked for any of them. Here is my code that is supposed to run the animation but it isn’t playing it:
local dude = script.Parent
print("finish0")
local AnimationValue = "rbxassetid://14138511268"
local NewAnimation = Instance.new("Animation")
NewAnimation.AnimationId = AnimationValue
local Humanoid = dude:WaitForChild("Humanoid")
local Animator = Humanoid:FindFirstChild("Animator")
local IdleLoad = Animator:LoadAnimation(NewAnimation)
IdleLoad.Looped = true
IdleLoad:Play()
I have looked at many tutorials and many forums and I havent found any solutions to this. I haven’t done much with animations in the past year so please correct me if I am wrong about something
To me this code seems kinda correct to me, with one possible error that I would try:
local NewAnimation = Instance.new("Animation")
NewAnimation.AnimationId = AnimationValue
NewAnimation.Parent = game.ReplicatedStorage
And see if that changes anything. If it doesn’t, A common issue on the dev forum when Animations don’t work is an ownership issue. If the game is under a group → group must own the animation! Not you. If the game is under a different user → That different user must own it! If the game is owned by you → You must own it! If it is not an ownership issue and the above idea doesn’t work. Let me know
here is the picture, also I found out that when I rig the humanoidrootpart to the lowertorso, the character starts slowly spinning in a circle and their position and orientation aren’t changing which is very odd and could be one of the reasons that the animation isn’t playing. Again, I don’t know and I am just throwing out ideas here.
Thank you, because I didn’t know that and now I have imported all the animations to the group, but it didn’t fix it, sadly. I also ran into another issue where the avatar is randomly spinningwhich might be interfering with the animation playing somehow. I have found that it is linked to the HumanoidRootPart being rigged to the LowerTorso but the thing is, even when I delete the rig between them, it stops the spinning, but it still doesn’t play the animation. I already posted a picture of the hierarchy to another guy if you need to see that too.
I’m not into rigging as I let usually a modeler/Builder who is in the team (Often work in teams of developers) make the custom rig. But I mean make sure that HumanoidRootPart is the primary part of the model?
I read through that and I double checked everything and I seem to have done everything correct but again, this is my first time animating/rigging a custom character.
Okay this is a good and bad thing because it is probably more simple of a fix than I thought, but I opened the output and it isn’t printing the “finish0” things?
Is it a local script in the workspace? If so they don’t run in workspace. Meaning you need to place the local script in a place that works or use a normal server script.
I am pretty sure that I need to use a localscript to run animations on all clients with this code, so where would I put the localscript at? (sorry I am braindead right now)
For all clients, thats what a server script does. Now why you would want to use a local script is if Player A sees Idle one Animation, while player 2 Sees a different animations entirely. But both are happening at the same time. Not saying that you have to use a server script, but server scripts act like an all client local script in a way
If you want to use a local script, put it in StarterPlayer → StarterPlayerScripts
Everything part is unanchored/CanCollide is off? You adjusted the hip height in the Humanoid? You make sure the rig type is R15 (usually the default one for custom rigs). Animations in r15? No errors in output? (Just going the list of common errors at this point)
When I put cancollide off, he falls off the map so would I have to do something with BallSocketConstraints or is there an easier solution? (assuming this is the reason the animation isn’t playing.
Keep CanCollide on with the HumanoidRootPart? (Shouldn’t have to need anything like that, I’m looking at one of the custom rigs we made and it doesn’t have any of that)