This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I don't know why but... it looks like get-global-mouse-position() is giving the wrong coordinates... exactly 60 degrees wrong...

my code here:

func _process(delta):
    a = get_global_mouse_position()
    look_at(a)
    print(a.x)

i am using the code in an area2d , and there is no modification of the position of the area...

any idea how to resolve this?

EDIT: the problem is already solved

Godot version 3.5.1
in Engine by (38 points)
edited by

Did you rotate the area2D in the editor?

What is the value of a.x when the mouse is at the far left and far right of the screen?

sorry for the delay, but I identified the problem, the mouse position was correct, the problem is that there were 2 objects together, the first was invisible and the second was in the wrong position, implying that what was wrong was the first object and its script

a very silly mistake on my part lol, I'm still learning how some engine specific functions work...

once again... sorry for the delay in my reply and thanks for the consideration of helping me with the question

Please log in or register to answer this question.

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.