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

plugin related - animation not playing for some reason?

Asked by
Lunaify 66
4 years ago

so im trying to make this plugin for my friend that loops through animations within a folder and then loads them into a rig's humanoid and then plays them, but this doesn't seem to work and i literally have no idea why


--//animation plugin for alimr local toolbar = plugin:CreateToolbar("AirLive1") local createAnimationFolder = toolbar:CreateButton("create animation folder","creates an animation folder","") local previewAnimation = toolbar:CreateButton("preview animation","previews the animation","") local function createAnimFolder() local animFolder = Instance.new("Folder",workspace) animFolder.Name = "Animation Folder" for i = 1,3,1 do local animString = Instance.new("Animation",animFolder) animString.Name = "Animation "..i end end local function previewAnimationFunc() local selection = game.Selection:Get() if selection[1].Name == "Animation Folder" and selection[2].Name == "Rig" then print("Yes v2") local rig = selection[2] local humanoid = rig:FindFirstChild("Humanoid") for i,a in pairs(selection[1]:GetChildren()) do print(a.Name) local track = humanoid:LoadAnimation(a) track:Play() end end end createAnimationFolder.Click:Connect(function() createAnimFolder() end) previewAnimation.Click:Connect(function() previewAnimationFunc() end)

1 answer

Log in to vote
1
Answered by
Norbunny 555 Moderation Voter
4 years ago

Unfortunately, animations only work during runtime (when you run/play the game).

In order to see the animation play, you will need to run the game and use the plugin.

0
alright, thanks Lunaify 66 — 4y
Ad

Answer this question