I'm making a 3D game but the camera is fixed to make it look like an isometric game, like how Project Zomboid's camera is set up.
I have a 3D object which is just a simple cube sitting on a 3D Mesh (Supposed to be my player). I've used the following code to make it look at the mouse:
var from = $Camera.project_ray_origin(get_viewport().get_mouse_position())
var to = from + $Camera.project_ray_normal(get_viewport().get_mouse_position())
all is well except that the whole cube is rotating in all axis, I just want it to rotate on its y axis, essentially locking the x and z axis to zero. How can this be achieved? Thank you!