Why Two Global Mouse Position are different, UI and Node2D

I want to print a pop-up text when the player clicks on a button in the UI but the global mouse position from the UI is too far from the position that I want to print, how can i fix this? Please help, thanks

Please provide more details about how you have setup the scene tree.
With so little detail, that you have provided, this question can’t be answered.

Just a guess, but maybe you need to use the local mouse position?

1 Like

I fixed it my way, I just tell the pop-up text to spawn at the global mouse pos function of the Node2D, I’m not using the mouse pos function in the Control class anymore

See the documentation, they are different by design. You should be able to use get_global_mouse_position instead.