Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change character's position?

Asked by 5 years ago

I have a simple question. Where exactly would I be able to find the character's position and change it with a script?

0
You would actually manipulate their HumanoidRootPart's CFrame and set it to the location's CFrame. If the location is a Vector3, you would set their CFrame to CFrame.new(Vector3). Alternatively, you could teleport them to a Vector3 using the MoveTo() method. DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

This is not a request site, but here's an example:

local plr = game.Players.LocalPlayer
local char
plr.CharacterAdded:Connect(function(c)
char = c
end)
repeat wait() until char
char:SetPrimaryPartCFrame(CFrame.new(15,15,15)) --You can change the X,Y, and Z
0
What exactly does char do? destroyer172769 0 — 5y
0
its what you see in game, what you move. Dalbertjdplayz 37 — 5y
0
"char" as he defined it is a reference to the player's model in the workspace. He's using the function SetPrimaryPartCFrame to set the position of the entire model based off of the model's PrimaryPart position. MegaManSam1 207 — 5y
Ad

Answer this question