AlignOrientation Constraint

I am trying to align a part with the direction the player is facing, but only on the Y rotation axis. I am using an AlignOrientation constraint to do this (one attachment mode), and it works when align type is set to primary axis parallel. This is the code I am using:

RS.Remotes.CameraPos.OnServerEvent:Connect(function(player, goalCFrame)
	local UFOCFrame = script.Parent.Seat.CFrame
	AlignOrientation.CFrame = goalCFrame
end)

but I would like to be able to have it on all Axis mode, and instead adjust the CFrame to make it only align on the Y axis, while keepint the other two at zero. I have been trying different versions for hours and nothing has worked, any help would be greatly appreciated!

RS.Remotes.CameraPos.OnServerEvent:Connect(function(player, goalCFrame)
	local UFOCFrame = script.Parent.Seat.CFrame
	AlignOrientation.CFrame = CFrame.lookAt(goalCFrame.Position, goalCFrame.Position + goalCFrame.LookVector * Vector3.new(1, 0, 1))
end)

try this

1 Like

Thanks! that worked immediately, I’ve been struggling on this for so long its really appreciated. Any idea where I can read up on this to get better at it myself?

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