How to add a node to the parent with set_global_mouse_pos() on Android?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GodotDroid
:warning: Old Version Published before Godot 3 was released.

I want to add a node to the parent according to the position of mouse clicks by using this code set_global_mouse_pos ().
when running on a desktop that looks good, but when running on Android device, the position of a node is inaccurate.
after many days, I have not found a solution.
what is wrong and how to do the trick?
Here is a simple project Flying-Fruity-Bird

What do you mean by the position is inaccurate? Is it a LITTLE inaccurate or A LOT inaccurate?

DodoIta | 2017-03-11 15:42

Please see this video Redirecting...

GodotDroid | 2017-03-11 23:44

:bust_in_silhouette: Reply From: GodotDroid

I’ve found other solutions, it works for both desktop and android. See example project.

var pos_a = event.global_pos - get_global_transform_with_canvas().get_origin()
node.set_global_pos(pos_a) #pos_a *camera_zoom

and this node.set_global_pos(get_global_mouse_pos()) has been confirmed as a bug.
Hopefully be fixed soon.

This has been fixed in #8035