How to rotate a Camera2D independently of its parent?

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

I have a Camera2D that is a child of my Player. I want to rotate the camera but not my Player.

I see that there’s a rotating property of the Camera2D, but this only specifies whether the camera rotates with its parent. I see no way to manually rotate the Camera2d via GDScript.

Is there a way to rotate a Camera2D in GDScript, independently of its parent?

:bust_in_silhouette: Reply From: eons

Camera2D is a Node2D, it has rotation and rotation_degrees property inherited from Node2D and you can use those.

If you want it to rotate the player in some direction and the camera separated, then you may need another scene setup.