How to position a cloned NPC

:wave: Hey there everyone! :wave:

I am currently trying to make a mirror scene like the one in camping 2. (You can refer to my original post for a better explanation)

What I need to do is clone all of the player’s characters and position them to make it look like they are looking at their dead bodies in the mirror.

Also, before posting a reply, please note that I already know how to make the mirror, I just need to figure out how to teleport AND position an npc with a script.

I don’t really know where to start, but any help is appreciated! :slight_smile:

1 Like

A good start would be posing the dummies in the positions you want. Then, set each dummies appearance to the players using the following code:

local Players = game:GetService("Players") 
local Dummies = workspace.Dummies

for i, Player in ipairs(Players:GetChildren()) do
	local PlayerAppearance = Players:GetHumanoidDescriptionFromUserId(Player.UserId)
	for i2, Dummy in ipairs(Dummies:GetChildren()) do
		local Humanoid = Dummy.Humanoid
		Humanoid:ApplyDescription(PlayerAppearance)
	end
end
2 Likes

You could clone each character part and position them separately by applying the CFrame, but you need to mirror it, for example positioning everything first then rotate the model 180 degrees.

Thank you for the reply, It transforms the dummy perfectly, now I just need to figure out how to position them… :thinking:

I feel like that would be a little overcomplicated, especially with multiple players in the game…

I would lay out each dummy roughly where you want. Then, using the animation editor pose each character and export the animation. Once the humanoid description has applied, you can then also load the animation the same way you would load any other animation.

1 Like

Sounds like that will work. Thanks!

It’s just a little complicated with all of the characters and posing, but if this works, I will let you know.

Edit: It worked! Thank you so much :smiley:

1 Like