local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humrp = char.HumanoidRootPart
local part = workspace.Part
while true do
humrp.CFrame = CFrame.lookAt(humrp.Position, part.Position)
task.wait()
end
What I want:
To have the player face the part without leaning, but my brain is too small for the maths.
You could just make the player look at the Parts x & z coordinates, The y cord would be the players root part. This would make delta Y 0, so no looking up or down.
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local head = char:FindFirstChild("Head") or char:WaitForChild("Head")
local part = workspace.Part
while true do
head.CFrame = CFrame.lookAt(head.Position, part.Position)
task.wait()
end
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humrp = char.HumanoidRootPart
local part = workspace.Part
while true do
humrp.CFrame = CFrame.lookAt(humrp.Position, Vector3.new(part.Position.X, humrp.Position.Y, part.Position.Z))
task.wait()
end