Rotating character to align with part not working

Title says it all. Trying to rotate my character to face towards the part

print(Player.Character:GetPivot())
Player.Character:PivotTo(CFrame.new(Player.Character:GetPivot().Position, spot.CFrame.LookVector))
print(Player.Character:GetPivot())

image

18:32:09.113 61.1252289, 26.2694817, 216.071487, 0.989250541, 3.84225052e-09, -0.146230459, -2.20679048e-08, 1, -1.23014289e-07, 0.146230459, 1.24918955e-07, 0.989250541 - Client - Fishing:32
18:32:09.114 61.1252289, 26.2694817, 216.071487, 0.962565541, -0.0313617513, 0.269228667, 0, 0.993283689, 0.115705051, -0.271049112, -0.111373693, 0.956100583 - Client - Fishing:34

Look vector is not orientation, you should use orientation of the part

I’m unsure why that wouldn’t work… the second parameter of a cframe is lookvector, so if I give it a lookvector, it should face in that direction

LookVectors wont rotate. LookVectors look at the object straight ahead of the player. It’s a “foward-direction component” according the the dev hub. You should use orientation at that’ll actually rotate your character.

CFrames are a powerful tool for changing both the position and orientation of instances in the workspace, but only if you know how to use them.

local humRP = Player.Character.HumanoidRootPart
humRP.CFrame = CFrame.lookAt(humRP.CFrame.p, spot.CFrame.p)

This bit of code is going to rotate the character’s HumanoidRootPart to face towards the part, in every axis. That means that the character is going to tilt forwards to look down on the part (assuming humRP.Position.Y ~= spot.Position.Y), so we can make an addition to this:

local humRP = Player.Character.HumanoidRootPart
humRP.CFrame = CFrame.lookAt(humRP.CFrame.p, Vector3.new(spot.Position.X, humRP.Position.Y, spot.Position.Z))

The above will rotate the character towards the part while keeping the character upright.

If you plan to improve upon your scripting so that you don’t have a problem like this in the future, I would recommend having a brief look over the CFrame constructors at the very least.
https://developer.roblox.com/en-us/api-reference/datatype/CFrame