Part Rotating Wrong

local Part  = script.Parent

function detected(char)
	while task.wait() do
		Part.CFrame = CFrame.lookAt(Part.Position, char:GetPivot().Position)
	end
end

script.Parent.Event.Event:Connect(function(char)
	detected(char)
end)


Its rotating as X,Z i just want it for X but i don’t know how can i do it.

Part.CFrame = CFrame.new(Part.Position) * CFrame.Angles(math.asin((char:GetPivot().Position - Part.Position).unit.Y), 0, 0)

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