0 votes

I pick objects using event position info. But when I navigate the camera around, event position is useless, I can't locate the objects I want to pick through the displaced camera. How can I fix it?

PS: It's a 2D top down scene.

Thank you for your time!

Godot version 3.2.3
in Engine by (335 points)

Please update your question with some code and maybe explain which event you use and how the camera is moving?

1 Answer

0 votes

Since your game is 2D, and 2D nodes inherits from CanvasItem, you can use get_global_mouse_position and get_local_mouse_position methods to get global and local mouse positions, respectively. You probably need global mouse position to handle objects pickup actions.

by (1,652 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.