Model rotating the wrong Y axis

Trying to make to model look at the player but it does look at the player but its facing backwards aka 180 degrees wrongly, i’ve tried multiplying the y axis by -1 but it doesn’t work.

local part = script.Parent.PrimaryPart
local charPos = playerCharacter.HumanoidRootPart.Position
local lookAtCFrame = CFrame.lookAt(part.Position, charPos)
local modelCFrame = CFrame.fromMatrix(part.Position, lookAtCFrame.XVector, part.CFrame.YVector, lookAtCFrame.ZVector) 

Then rotate it on the Y-axis 180 degrees (which is math.pi in radians).

modelCFrame * CFrame.Angles(0,math.pi,0)

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