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

How would I position the HumanoidRootPart with CFrame?

Asked by
rdkv 12
5 years ago

I've tried every possible way yet come to no avail, i'd appreciate any help.

Line:

char.HumanoidRootPart.CFrame = CFrame.new(Vector3 -2,6,2)

Full script:

local player = game.Players.LocalPlayer local char = player.Character char.Humanoid.WalkSpeed = 0 char.Humanoid.JumpPower = 0 char.HumanoidRootPart.CFrame = CFrame.new(Vector3 -2,6,2)

Thanks for your time and consideration.

0
The variables got a bit bundled up, but local player and local char should be separated above and under each other, and a gap should separate them from the whole script. rdkv 12 — 5y
0
maybe try moving the torso's CFrame stinkyest11 78 — 5y
0
do CFrame.new(Vector3.new(-2,6,2)) radusavin366 617 — 5y

1 answer

Log in to vote
1
Answered by
Axdrei 107
5 years ago

Hello rdkv!

You're using CFrame.new wrong!

You need to use CFrame like CFrame.new(Vector3 pos)

What does that mean? Well I will give you an example

local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-2,6,2))

Good luck, if you have any questions tell me!

0
This should work. AswormeDorijan111 531 — 5y
0
you could also use Character:SetPrimaryPartCFrame() User#19524 175 — 5y
Ad

Answer this question