Fix camera rotation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By SoMir

I have a game where I have a spaceship in space (duh) .

I’ve made nice movement and rotation for the space ship, but the camera, that was made following this Interpolated Camera, when I do a vertical 360 degree spin, it kinda turns in a weird way when you’re looking down(it kinda turns around instead of just following and being upside down like the spaceship).

How can I make it so that there isn’t a “Right side up”? Since it’s in space, there shouldn’t be up and down, you should move freely.

I don’t entirely know what the problem is. Is the camera suppose to turn around in a full circle? Or is the camera suppose to turn in whatever direction? From the look of the code in the link, the camera looks at a position with the, well, look_at() function, which takes the Vector3.UP direction as the second parameter. That could explain the “right side up” problem.

Ertain | 2021-06-14 17:48

Yup, I think that’s the problem. Since the game is in space, I’d like the camera to not look for the right side up, but rather just follow the spaceship as it rotates.

SoMir | 2021-06-14 17:53

:bust_in_silhouette: Reply From: SoMir

Welp, I fixed it.

I just completely removed the look_at() function. Tbh, the camera moves even better now.