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

How would I position the HumanoidRootPart with CFrame?

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.

3 comments

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.

0

maybe try moving the torso's CFrame

0

do CFrame.new(Vector3.new(-2,6,2))

1 answer

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!

2 comments

0

This should work.

0

you could also use Character:SetPrimaryPartCFrame()

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