Okay, so I know I just posted like an hour ago and I’m sorry to be such a nuisance, but I’m having another problem. I made an animation for an NPC in my game that is eating at a table, and another that is in the back sleeping on a couch. I don’t know why, but when I run scripts in studio, the animation and scripts work just fine, but when I play in-game, they don’t work. Is there a reason for this?
The script is,
local Human = script.Parent:WaitForChild("Humanoid")
if Human then
Animation = Human:LoadAnimation(script.Parent.Animation)
Animation:Play()
Animation.Looped = true
end
maybe you didn’t upload the animations to whatever owns the game? If it’s a group game, the animations need to be uploaded to the group. if it’s a game on your profile, the animations need to be uploaded under your account
if that still doesn’t work, you could put something like wait(30) on top, join the game, then see if an error appears when the script does :LoadAnimation
HUMANOID:LOADANIMATION() IS NOW DEPRECATED. Use Animator instead, you can create an instance of it, it also appears in player’s Humanoid. Use that to load animation like Animator:LoadAnimation().