Clone of the Player isn't loading animations

I am currently making a “rasengan”. I want the script to make a clone of the player that plays an animation, however it seems to not load an animation.

Here is the script I made as well.

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local debounce = false

ReplicatedStorage.Remotes.Rasengan.OnServerEvent:Connect(function(player)
	if debounce then return end
	
	local character = player.Character
	local cloneSeal = character.Humanoid:LoadAnimation(script.CloneSeal)
	local rasenganHold = character.Humanoid:LoadAnimation(script.RasenganHold)
	
	cloneSeal:Play()
	cloneSeal:GetMarkerReachedSignal("Seal"):Connect(function()
		debounce = true
		character.Archivable = true
		local clone = character:Clone()
		clone:FindFirstChild("Animate"):Destroy()
		clone:FindFirstChild("Health"):Destroy()
		clone.Name = character.Name.."'s Clone"
		clone.HumanoidRootPart.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(3, 0, 0)
		clone.Parent = workspace
		clone:WaitForChild("Humanoid"):LoadAnimation(script.RasenganForming)
	end)
end)
1 Like

Have you read the documentation on LoadAnimation? It returns an AnimationTrack, which must be played by calling :Play(). To call the function and get the returned AnimationTrack, you need to change the last line of your function (in this code sample given) to give you a local variable, which contains the AnimationTrack required to play the animation. Just loading it won’t do anything.

local track = clone:WaitForChild("Humanoid"):LoadAnimation(script.RasenganHold)

After that you need to put another line in your function to play the animation, using the AnimationTrack. track:Play() should do it. There are also a few functions such as AnimationTrack:Stop(), :AdjustSpeed(num), :AdjustWeight(num) which I think are really useful.

That’s all you have to do to load the animation.

1 Like

BRUH

I don’t know how I forgot to play the animation…

Thanks for pointing it out, its working just how I wanted.

1 Like