Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Answered! Why is my custom animation not working on my NPC in a live server?

Hi,

Context:

I am making an obby for a youtuber friend of mine, and one of the sections is where you walk on the legs of a giant sized NPC of the youtuber (as seen in the images below)

Path direction

Animation example

The Code:

I have the animation inside a script inside the NPC

NPC

AnimationScript

Animation

The script being

local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local move = humanoid:LoadAnimation(animation)
move:Play()

Animation ID: rbxassetid://5057261029

The Issue:

I have the above gif from a studio testing server, however when I test the game from the game's page on roblox.com it comes up with an error in the client log Animation "rbxassetid://5057261029" failed to load in "Animation.AnimationId": Animation failed to load and a similar message in the server log.

Notes:

I have tried the exact same code but I set the animation Id to "rbxassetid://507771955" (an official roblox animation) and it worked fine, so I know that the code is correct.

I tried re-exporting the animation as 'movement', instead of 'core' but no change occurred.

Any help or suggestions would be much appreciated, thanks in advance.

2 answers

I've had a problem with this before. Here you go.

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://PUT_ID_HERE"

local controller = ... -- path to Humanoid/AnimationController
controller:LoadAnimation(anim):Play()

This script is unfinished. But as it says, path the local controller to where the animation controller is in the Humanoid.

2 comments

0

Unfortunatly this still didnt work :(

0

Oof...

It turns out because somebody else is classed as the creator, they had to make the animation.

ANIMATIONS MUST BE MADE BY THE GAME CREATOR!

This discussion is preserved as it was. New answers, comments, and votes are closed.