Manage switching between multiple Camera2Ds
- Replace
Camera2D
with ourManagedCamera2D
- Add
CameraManager2D
to your scene - Add your cameras to the
CameraManager2D
- Use
ManagedCamera2D.enabled
just like how you useCamera2D.enable
Camera manager in Editor |
Managed camera in Editor |
Custom nodes added by addon |
Camera manager in GDScript |
Property | Type | Description |
---|---|---|
cameras | Array[ManagedCamera2D] |
Add your camera to the manager. Returns the camera index in cameras
array.
Get your camera from the manager.
Remove your camera from the manager.
Property | Type | Description |
---|---|---|
enabled | bool |
Controls wheter the camera can be active or not. Once ticked, other cameras in CameraManager2D would be disabled. |
cam | Camera2D |
Raw Camera2D |