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

How can I teleport the full body?

Hello, I have made a Zombie and when I click it teleports but it only teleports the torso. I can do this with my own character and it teleports the full body so I don't understand what the problem is. The code is in a local script in the starter gui. Here is the code:


plr=game.Players.LocalPlayer
mouse = plr:GetMouse()
mouse.Button1Down:connect(function()
	plr=game.Players.LocalPlayer
	mouse = plr:GetMouse()
	print(mouse.Target.Position)
	local zombie=workspace.DroolingZombie:Clone()
	zombie.Parent = workspace
	zombie.Torso.CFrame = CFrame.new(101, 0.5, 23)
	
end)

1 answer

zombie:MoveTo(101, 0.5, 23)

MoveTo will move the entire model by the center of the PrimaryPart or root of the model if the PrimaryPart hasn't been defined.

http://wiki.roblox.com/index.php?title=API:Class/Model/MoveTo

1 comment

0

Alternatively, you can use model:SetPrimaryPartCFrame(). It's weird that setting the CFrame of your zombie's torso won't move the whole model though. Is it the model's PrimaryPart? It should be.

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