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

How does animation work, exactly?

I've been trying to play a test anim in order to acquaint myself with the system, following this tutorial: http://wiki.roblox.com/index.php/Animations.

I have the plugin and made the test animation, but it doesn't play. I don't know if it's a problem with the animation code, or the code for having it happen when a brick is touched.

I'd also like to know, how do I set up an if/when to play the animation?

The script in question:

local brick = workspace.Part
brick.Touched:connect(onTouch)

local animation = Instance.new("Animation")
animation.Animation.ID = "http://www.roblox.com/item.aspx?id=315360368"
local animTrack = workspace.Player.Humanoid:LoadAnimation(animation)

function onTouch(part)
	animTrack:Play()
	
end

1 comment

0

output

1 answer

✓ Accepted answer

Animations have an AnimationId property. You wrote Animation.ID instead. AnimationId has to be an asset, and not an item.

Line 5 should be animation.AnimationId="rbxassetid://315360368"

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