I am using ‘AlignOrientation’ on my character to allow the character to rotate towards the cursor. The issue I am having is that while it rotates it is not facing the correct direction.
local alignOrientation = Instance.new("AlignOrientation")
alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
alignOrientation.Attachment0 = RootPart.RootRigAttachment
alignOrientation.MaxTorque = 10000
alignOrientation.Responsiveness = 25
alignOrientation.Parent = RootPart
RunService.RenderStepped:Connect(function()
local pos = Mouse:Project(150) --returns world position from mouse position w/ distance as the arg.
local unit = (pos - RootPart.Position).Unit
local direction = Vector3.new(unit.X, RootPart.CFrame.LookVector.Y, unit.Z).Unit
alignOrientation.PrimaryAxis = direction
alignOrientation.SecondaryAxis = direction
end)
As you can see from this short GIF the rotation is clearly not as desired.
https://gyazo.com/ecdab20a225d3f9850651bc2e64731ed
If anymore information is needed please don’t hesitate to ask!