Move_to on local coords

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

Hi,
I’m trying to move a kinematicbody2d inside a tilemap inside canvaslayer to a mouse click. When I use set_pos(event.pos)
everything works fine. However, I can’t do that with move_to (the node is not moved to correct coords) , so I have to use

move_to(event.global_pos)

instead. Question is - why can’t move_to accept event.pos?

Thanks

:bust_in_silhouette: Reply From: Antonb

I managed to convert the coordinates from local to global using:

get_node("/root/global").player_pos = self.get_global_transform().xform(event.pos)