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

How do I animate cloned player?

I am trying to make an exact copy of a player when the player joins, but when I do this, it is not animated. Do you have to make a whole new animation script to put in this now NPC, or do you sort of "reload" the script? I've tried copying a script from a free model, and it works, but it causes errors in the developer console and the animation seems jaggy/blocky. Keep in mind this is not a request, it is asking a question.

Script I made to duplicate the player (it's only for the client)

game.Players.PlayerAdded:Connect(function(p)
	local plr = game.Workspace:WaitForChild(p.Name)
	plr.Archivable = true
	local clone = p.character:Clone()
	clone.Parent = game.Workspace
end)

1 answer

try renaming the humanoid of the characters clone so u can get it better

game.Players.PlayerAdded:Connect(function(player)
	local character = player.Character or player.CharacterAdded:Wait() -- gets the players character
	local cloned = character:Clone() -- clones it
	cloned.Humanoid.Name = "ClonedHumanoid" -- so you can find it without getting your character later on
	local animation = Instance.new("Animation") -- new animation
	animation.AnimationId = "rbxassetid://" -- after the rbxasset put your animationid
	local animtrack = cloned.ClonedHumanoid:LoadAnimation(animation) -- loads the animation
	animtrack.Priority = Enum.AnimationPriority.Action -- highest priority
	animtrack:Play() -- players the animation (you can play this later on if you'd like)
--[[
just a quick demonstration on how to play animations
--]]
end)

1 comment

0

WAAAY too many comments.

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