I have certain NPCs and objects that i want animated with loop animations. They serve no other purpose, just to stand there with an animation (for example a smith working on an anvil).
How can i play those animations without inserting scripts into each of them? One way i came up with was inserting scripts into them, playing the looped animation and destroying the script, but i would like a more efficient way.
P.S. I know this might not be the right category, but building support also doesnt seem quite right
Obviously you can play the animation in some kind of a plugin such as Moon Animator to preview it, however you really need a script to execute it in the game, atleast in my knowledge.
local npcFolder = workspace.Npcs -- idk
local npcNames = {"examle"}
local RespectiveAnimation = {"animationID"}
function animateAll()
for i,v in pairs (npcFolder:GetChilldren()) do
if v.Name = npcNames[i] then
local findHumanoid = v:FindFirstChild('Humanoid') --or v:WaitForChild('Humanoid',true)
if (findHumanoid) then
local anim = instance.new('Animation')
anim.AnimationId = RespectiveAnimation[i];
local loadAnim = findHumanoid:LoadAnimation(anim)
loadAnim:Play()
end
end
end
end
OK there is a away but i tried it in one position animation and idk about loop
first use moon Animator and make animation then save map and quit without close moon animator then it will work