How do I align the camera with the horizon such that the horizon is always on a horizontal line compared to the screen. Currently I’ve been using the looking at function with Vector3.UP as the up direction. This works fine but bugs out when looking straight up and down. How would I make this work.
Currently my code to align it looks like this
var a = Transform3D(camera_aim, Vector3.ZERO) camera_aim = a.looking_at(-camera_aim.z).basis
If it helps I’m trying to create a war thunder like plane controller. Example