How to switch between two Camera2Ds in different scenes

Godot Version



I’m using switching between scenes in my game, kind of like in Pokémon when you start a battle, and I used this method to swap over to the fight scene so that my main game scene doesn’t get reset like it would if I used the change_to_scene method. I made the fight scene work when the game is paused so that I can pause the main game and just run the fight scene.

func _on_enemy_area_body_entered(body):
	if( == "Player"):

func swap_level():
	get_tree().paused = true

The problem with this is that the camera I put on my player node is being used by the fight_scene so it doesn’t show it properly. Is there any way to swap over to a camera node I put in the fight_scene?

this is my bossfight camera switch linked to signal

Player enteret the fight scene scene


End fight scene


of course this is version 3.2.3 maybe diferent method in 4.x

and result is something like this

The cameras would be in different scenes how would I change them both in one scene?

docs 4.2 says:

bool enabled = true

  • void set_enabled ( bool value )
  • bool is_enabled ( )

Controls whether the camera can be active or not. If true, the Camera2D will become the main camera when it enters the scene tree and there is no active camera currently (see Viewport.get_camera_2d).

When the camera is currently active and enabled is set to false, the next enabled Camera2D in the scene tree will become active.

Thanks this worked for me I used a func in main to enable the cam in it when the scenes got swapped.

code from

func swap_level():
	get_tree().paused = true
func enable_cam():

code from

func swap_level():
	get_tree().paused = false

Thank you EX74!!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.