I’m making a building tool, but I can only orient the selected structure’s root exactly to the overall orientation of the player’s camera using an AlignOrientation. I’m trying to find out how I can fix the model root’s X axis to stay upright FOR ETERNITY.
If you cross the camera direction with the Y axis, you will get a new axis that always points at the horizon. If you use that and the Y axis to create a CFrame, it will do what you’re describing. It may be rotated on the Y axis but you can just undo that with another CFrame.
My previous piece of code (the one present in the video) is this.
orient.CFrame = camera.CFrame
The new one that I tried to make based on my understanding of your reply is this.
orient.CFrame = CFrame.new(0, camera.CFrame.Y, 0)
The new one kinda doesn’t work with the AlignOrientation not doing anything and just facing a default direction. I might not be doing it correctly.
