Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't the animation playing?

Asked by 5 years ago
Edited 5 years ago

I recently made an animation and wanted to make the npc play it. After making the animation I wrote a script and put it in the npc I wrote

script.Parent.ClickDetector.MouseClick:Connect(function(player)
local track = script.Parent.Humanoid:LoadAnimation(script.Parent.AnimSaves.TestAnim)
track:Play()
print("yay")
end)

After writing the script I found out that the animation wouldn't play but would print yay. I tried adding track:Stop but it woludn't fix it. How wolud I fix it? Thank you if you answer

0
Not sure if I remember correctly, but I believe that ClickDetectors with a server script doesn't really work in FE. I would make this a local script and use LocalPlayer instead. PhantomVisual 992 — 5y
0
It is a normal script and the animation is for the npc I also tried turning it into local script and it is still not working turquoise_monkeyman 32 — 5y
0
@PhantomVisual What? LocalScripts can't even run in the Workspace. DeceptiveCaster 3761 — 5y
0
I meant that having the script be a server script while FE is enabled won't trigger the clicked event. However, if you use a local script (and place it where it can run on ghe client) you can use LocalPlayer as the player who clicked it. PhantomVisual 992 — 5y
View all comments (4 more)
0
No, what you strictly said is "make this script in the ClickDetector local" which renders the script unable to run. DeceptiveCaster 3761 — 5y
0
Plus, FE does not affect a ClickDetector unless the script associated with it is doing something that should be done on the client. Scripts in ClickDetectors should be server scripts. The type of script that is used with a ClickDetector is entirely irrelevant. DeceptiveCaster 3761 — 5y
0
^ Ignore what I said about ClickDetectors not returning the player who clicked it while FE is enabled, @RobloxWhizYT was correct. PhantomVisual 992 — 5y
0
ok thats good but I have already got the answer turquoise_monkeyman 32 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

That's probably because the animation does not have an ID. To make an animation with an ID, follow these steps:

  1. Open Animation Editor and select your NPC
  2. Click File > Export
  3. Upload the animation
  4. Once it's 100% uploaded, copy the link in the box below
  5. Insert an Animation instance
  6. Copy the link into the AnimationId value, but keep the number and get rid of the '0' at the last digit of the ID
  7. You can now use LoadAnimation() on the animation and now your NPC should do the animation once you run the game!

That should be useful for you!

BTW, you used an invalid ID, for example: fe3db201e86f1c9bbd9ffeef322a95e2. Roblox will read that as an ID that is not on their website, so the animation does nothing.

0
what lol DeceptiveCaster 3761 — 5y
0
First of all, a hexadecimal string isn't even an ID because IDs consist of numbers, not letters and numbers. So by saying that it's an ID, you're wrong. What you're claiming is an ID is actually a bunch of hexadecimal pairs. DeceptiveCaster 3761 — 5y
0
Ok. Thank you for letting me know! Owengren 31 — 5y
0
My id is 3079190401 what ID should I put in? If i put that in it says unable to cast value to object turquoise_monkeyman 32 — 5y
View all comments (3 more)
0
Question: Is it in rbxasset format? DeceptiveCaster 3761 — 5y
0
its this one https://web.roblox.com/catalog/3079190401 turquoise_monkeyman 32 — 5y
0
Thank yer so so much turquoise_monkeyman 32 — 5y
Ad

Answer this question