Camera2D rotation independent of parent

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Martin Eigel
:warning: Old Version Published before Godot 3 was released.

Camera2D zooming and panning works fine but rotation (set_rot) does not seem to have any effect. Why does this not work as expected?

Additition to original question: When set_rotating(true), camera will rotate according to parent. How could one define a Camera2D which still moves with parent, still is rotateable but rotates independently of parent?

:bust_in_silhouette: Reply From: Zylann

Never tried it, but you can use camera.set_rotating(true) to enable the rotation.

Thanks but this does not work as described in the question since this (kind of) rotates the viewport according to the movement of the camera automatically.

I am wondering if it is a bug that Camera2d ignores set_rot() or something else, i.e. a feature maybe…

Martin Eigel | 2016-07-29 20:27

Well, I tried to set a rotation script on a test camera and it works. Enabling rotating will make the camera follow set_rot() (including the one from its parent). I did that in Godot 2.1 rc1 btw.

Zylann | 2016-07-29 21:06

Ok, set_rotating(true) enables it.

Martin Eigel | 2016-07-30 16:12