Skip to content

Change in Camera2D.current behavior in 3.3.2 #50091

Closed
@noidexe

Description

Godot version

3.3.2.stable.official

System information

Windows 10, GLES 3, GTX 2060

Issue description

In Godot 3.2.3 and previous versions, if you had more than one camera in a scene with "current" activated, the last one in tree order would become the current camera.

For example here lvl_camera shoud become current when the scene loads.
image

In Godot 3.3.2 it seems it's no longer the case. The first camera in tree order seems to be the one that becomes current. There is something even more weird. In the same example if I move the Player node below the lvl_camera node like this:
image
When the scene loads lvl_camera will be current but as soon as the player moves, the camera inside the player will become current.

Another thing I noticed is that if I check the remote tree both cameras have current set to true. It also seems to happen only when the camera is part of an instanced scene.
Maybe something wrong here? https://github.com/godotengine/godot/blame/ee115d7b2d5385a80710c0f0a16009640193ff93/scene/2d/camera_2d.cpp#L417

Steps to reproduce

  1. Open Node2D.tscn in the provided project
  2. run the scene
    Expected: Only one camera should have current set to true. lvl_camera should be active
    Actual: Both cameras have current set to true. player/camera is active

Alternative test:

  1. Open Node2D.tscn in the provided project
  2. Swap the tree order of player and lvl_camera so that player comes last:
    image
  3. Run the scene
  4. Move the player using arrow keys
    Expected: Only one camera should have current set to true. player/camera should be active
    Actual: Both cameras have current set to true. lvl_camera is active until you move the player, then player/camera becomes active. Both still show current ☑ in the remote tree

Minimal reproduction project

CameraBug.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions