I’ve searched far and wide for a solution and none of the things I’ve seen have offered a solution. I’ve reuploaded the animation multiple times, changed worlds and even changed the code yet I’m still getting the same error no matter what I do. I don’t know if its something obvious that I’m just not seeing but help would be heavily appreciated. I am simply trying to play an animation onto a character model.
The script is inside of the serverscriptservice and is a server script. If I’ve done something wrong, I would love to find out
local char = game.Workspace.Characters.Character
local anim = script.CharAnim
local humanoid = char:WaitForChild("Humanoid")
local charAnim = humanoid:LoadAnimation(anim)
charAnim.Looped = true
charAnim:Play()
If the game you’re on is under a group you need to make sure that the animation is published under the group, not your actual account. At least that’s the only way that I can get this to happen to myself.
Though if it’s happening regardless maybe posting a screenshot of the actual output error would be helpful, alternatively it might be some kind of Roblox delay as I’ve heard that sometimes it can take up to a day for animations to be published properly, but I’ve never had that happen to me before.
The game is under myself. I created a brand new world under me to make sure that the original world was under me and it still gave me an error. The code that is says is the error is the 4th line of code “local charAnim = humanoid:LoadAnimation(anim)”
Oh wow, yeah that is weird. I can’t seem to find any actual information on this nor can I replicate it. Though, I have a question about this line here:
local char = game.Workspace.Characters.Character
What is this actually referring to? Does it still happen if you do this?:
local char = game.Workspace.Characters:WaitForChild("[yourusername]")
If it does still happen, I’m assuming that “Characters” is a folder, so then what about keeping the player character in the workspace, ignoring said folder, and doing this instead?
local char = game.Workspace:WaitForChild("[yourusername]")
Of course this isn’t the “definitive” solution, just trying to narrow down what the potential issue could be here.
The character in this case is an avatar inside of a folder. It is not an actual player but a model that is already within. I did just try the code you suggested and it did still give the same error. Heres an image of what the folder looks like. Kazumi_Kazo is the model being referenced (in the script it is referenced correctly) the code below is what my code looks like:
local kaz = game.Workspace.Characters:WaitForChild("Kazumi_Kazo")
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://117609715948481"
anim.Parent = script
anim.Name = "KazAnim"
local KazAnim = kaz.Humanoid:LoadAnimation(anim)
KazAnim.Looped = true
KazAnim:Play()
I used the exact code you used (except with my own animation of course) and can’t get this to happen at all. The last thing I can think of is to share what my repro is just to be sure it actually is the same as yours, and if it is and you’re still having the problem, then I think it’s safe to say that it’s some kind of bug on Roblox’s end.
So here’s the place file I used to test with, script in ServerScriptService as yours is, replace the empty quotes in it with your animation ID, and change the “Char” variable at the top to the R6 or R15 one depending on if your animation is for R6 or R15. animTest.rbxl (136.4 KB)
If it still doesn’t work I’d recommend making a bug report on the devforums, if you don’t have access to the bug reports category then you can actually submit a bug report on the Roblox support page. (Type of help category above description of issue has a “Bug Report” option.) Just give them a clear and concise view on what’s happening and make sure to include the asset ID of your animation that’s erroring cause maybe the asset is somehow getting corrupted when being uploaded. That’s just speculation though, I really hope that you get this sorted out!
It must be a me issue. I just tried it and replaced it with my animation and i got the same error as usual. From what I’ve seen from digging around it people say its either a studio bug, world isn’t mine or i uploaded the animations incorrectly.
I thought you were, but after double checking you seem to be doing it just fine. Maybe try using an animator in the Humanoid? Kinda a last resort though
This error is very weird and can mean all sorts of things
I did try referencing the animator inside of the humanoid instead of the humanoid and im fairly sure nothing happened. didnt get an error but no animation played. not 100% sure tho i just know it did not work.
Do you mean does it have multiple animations that are trying to be played at the same time? if so it’s only 1 animation. I’m not sure if it would affect anything but in Moon Animator it is apart of two different animations, one with all of the rigs/characters and one with just itself
I figured out the solution, at least for my issue. The way I was exporting was through Moon Animator in the ServerStorage as I always did. To fix this issue, I went into the rig I was using and exported the animations from the “AnimSaves”.