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

how do i make player facing cursor?

How do i make a player is alway facing cursor without locking cursor (i want the cursor to be free moving)

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

repeat wait() until Player.Character; local Character = Player.Character

game:GetService("RunService").RenderStepped:connect(function()
	Character:WaitForChild("Torso").CFrame = CFrame.new(Character.Torso.CFrame.p, Vector3.new(Mouse.Hit.X, Character.Torso.CFrame.p.Y, Mouse.Hit.Z))
end)

This LocalScript is in player gui

Sorry for my bad english

1 answer

✓ Accepted answer

You have it almost right, you should be changing the cframe of the humanoidrootpart not the torso.

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

repeat wait() until Player.Character; local Character = Player.Character

game:GetService("RunService").RenderStepped:connect(function()
    Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.new(Character.HumanoidRootPart.CFrame.p, Vector3.new(Mouse.Hit.X, Character.HumanoidRootPart.CFrame.p.Y, Mouse.Hit.Z))
end)

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