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

How to play a animation into a cloned dummy?

local repStorage = game:GetService("ReplicatedStorage")
local RemoteEventFolder = repStorage:WaitForChild("RemoteEvents")
local ServerStorage = game:GetService("ServerStorage")
local StandFolder = ServerStorage:WaitForChild("Stands")

local function SummonStand(plr)
	local Character = plr.Character
	local Stand = StandFolder.TheWorld.Stand:Clone()
	local sHRP = Stand.HumanoidRootPart
	local AimClone = script.StandIdle:Clone()
	AimClone.Parent = Stand.Humanoid
	local animation = Stand.Humanoid:LoadAnimation(AimClone)
	animation:Play()
	Stand.Parent = Character
	local Weld = Instance.new("ManualWeld", sHRP)
	Weld.Part0 = sHRP
	Weld.Part1 = Character.HumanoidRootPart
	Weld.C0 = sHRP.CFrame:inverse() * Character.HumanoidRootPart.CFrame
end

RemoteEventFolder.SummonStand.OnServerEvent:Connect(SummonStand)

Stand not playing animation? LoadAnimation requires the Humanoid object (Stand.Humanoid) to be a descendant of the game object

1 comment

1

Try to set Stand.Parent before you :LoadAnimation

1 answer

Try setting Stand.Parent before you :LoadAnimation so it will play to the right referenced instance.

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