I am trying to make the player teleport to a certain position but I do not understand what’s going wrong, this is the error.
Here is the line.
HumRoot.CFrame = CFrame.new(15, 15, 15)
I am trying to make the player teleport to a certain position but I do not understand what’s going wrong, this is the error.
Here is the line.
HumRoot.CFrame = CFrame.new(15, 15, 15)
Post the whole code or at least a little bit more up to where “HumRoot” is defined
Hi, so as CFrame is now replaced with position you will have to do HumRoot.Position = CFrame.new(15,15,15)
No, the Position
property takes a Vector3
value, not CFrame
.
Yes then they would need to do HumRoot.Position = Vector3.new(15,15,15)
wait shouldnt you just set the primary part’s cframe to CFrame.new(15,15,15)?
The HumRoot Variable is not defined. You need to make sure it is. That is what the error means.
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumRoot = Character:WaitForChild("HumanoidRootPart")
Also for teleporting a player you might want to use
Character:SetPrimaryPartCFrame(CFrame.new(15,15,15))
Instead as Roblox reccommends you do it that way.
There are actually two problems here:
CFrame.new(Vector3.new(15, 15, 15))
Edit: My bad, you can build a CFrame with 3 numbers. So, only 1 problem.
@jaidon11 error is saying that HumRoot
is nil. make sure HumRoot
isn’t nil. may i see what is HumRoot
?
The second point is false, you can make CFrame with three numbers. The CFrame constructor is heavily overloaded.