Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera2D.get_camera_screen_center() does not return desired position #61318

Closed
ron0studios opened this issue May 23, 2022 · 5 comments
Closed

Comments

@ron0studios
Copy link

Godot version

3.4.4-stable

System information

Arch linux

Issue description

When using the function get_camera_screen_center() to fetch the position of a camera, with limits and drag margins applied,m the function always returns (0,0) regardless of where the camera is positioned. I am trying to implement a camera-to-camera transition system.
The camera has set limits, but no smoothing or enabled drag margin
However, here's the weird part that got me to write this issue in the first place, once I set the camera to be current, the get_camera_screen_center() DOES return the correct value. Is this something to do with the camera not adjusting itself beforehand?

Steps to reproduce

  • create a camera that follows the player (source)
  • have a transition camera that is a global autoload camera
  • create another camera to transition to (destination)
  • have a function that Tweens between source.get_camera_screen_center() to destination.get_camera_screen_center()
  • the camera transitions to (0,0) and then snaps jaggedly to the actual camera position

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented May 24, 2022

Related to #44358.

@ron0studios Please upload a minimal reproduction project to make this easier to troubleshoot.

@Calinou Calinou changed the title get_camera_screen_center() does not return desired position Camera2D.get_camera_screen_center() does not return desired position May 24, 2022
@AThousandShips
Copy link
Member

Closing due to lack of response, if you provide the requested information this can be reopened

@AThousandShips AThousandShips closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2024
@rnoriega31
Copy link

Can confirm this still happens in 4.3.stable.

@Calinou Calinou reopened this Aug 17, 2024
@Calinou Calinou removed the archived label Aug 17, 2024
@Calinou
Copy link
Member

Calinou commented Aug 17, 2024

@rnoriega31 Could you upload a minimal reproduction project? Thanks in advance 🙂

@AThousandShips
Copy link
Member

Closing due to lack of response, if you provide the requested information this can be reopened

@AThousandShips AThousandShips closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants