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

How do I make an R15 animation play, and loop?

So I recently decided to change my game to R15 and I made a pretty good animation to go with one of the new NPCs but I can't seem to play any kind of animation. I've tried on multiple rigs, anchored and not anchored and to know avail. I'll include the script I've been using.

local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local animation = hum:LoadAnimation(script.Animation)

if char -= nil then
 animation:Play()
end?

Also if I was to fix it, how would I loop a 3-4 second animation with that same script?

1 comment

0

In lua not equals is ~=, not -=

1 answer

You can loop it by setting the loop of the animation to true.

local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local animation = hum:LoadAnimation(script.Animation)

animation.Looped = true

if char -= nil then
 animation:Play()
end?

i havent tested this, but it seems like everybody does this.

2 comments

0

Ok, but the script itself doesn't seem to work. Thanks for telling me how to loop though, but it's not helpful unless I can figure out why the script is broken.

0

Whats so broken?

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