Making NPC point at a part

I’m trying to make this NPC point at the part like this:

But it turns out like this:


So how can I make the CFrame.lookAt() function make the bottom look at the part, but not the front?
Here’s the script by the way

local Dummy = script.Parent
local Target = workspace.cooljoony34
local Neck = Dummy.Torso.Neck
local YOffset = Neck.C0.Y+.54
local Armer = Dummy.Torso["Left Shoulder"]

while wait() do
	Armer.C0 = CFrame.new(-1,0.5,0) * Armer.Part0.CFrame:Inverse()*CFrame.lookAt(Armer.Part0.Position, Target.Root.Position) -- THIS IS THE ARM THING!
	Neck.C0 = CFrame.new(0,YOffset,0) * (Neck.Part0.CFrame:Inverse()*CFrame.lookAt(Neck.Part0.Position, Target.Part.Position)*Neck.C1)
end

I think you just have to offset the rotation.
Try multiplying the “Armer.C0” with CFrame.fromOrientation(math.rad(90),0,0)

It automatically resets, no effect at all

UPD: I put math.rad(90) in Y rotation, not in X rotation. It works now

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.