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

plugin related - animation not playing for some reason?

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

✓ Accepted answer

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.

1 comment

0

alright, thanks

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