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

How do you play an animation in the player character once the player touches a part?

Asked by 7 years ago
Edited 7 years ago

The tutorial given on the ROBLOX Wiki isn't very helpful; I don't understand what it's trying to say. This is my current script, embedded into a LocalScript under Workspace, cobbled together with knowledge from a starter tutorial and part of the animation page on the wiki.

local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=584897633"

function start() 
    local animTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animation)
    animTrack:Play()
end

game.Workspace.Part.Touched:connect(start)

I have confirmed the animation itself to be working, as taking the asset ID and loading it into a default player animation while the game is running would appear to play the animation properly, given that the correct action is being taken by the player.

0
its um not a request site.... Abstract_Life 65 — 7y
0
Perhaps I should edit the content in my question, so as to not confuse people; after looking around, it's evident that what is asked is usually given anyway. I am looking for help on making the stated script, not just asking for a free script from the community. (Not quite sure whether or not this message will get to you, though.) awemanrank100 0 — 7y

Answer this question