thanks for your reply!
I now send the click location to the tilemap with the following code:
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed():
var global_clicked = event.position
gethex.emit(global_clicked)
To test this my code in the tilemap is the following:
func converthex(target):
print("cord clicked is " + str(target))
var hex = local_to_map(target)
print("hex clicked is " + str(hex))
var convert = map_to_local(hex)
print("unit is moved to " + str(convert))
hexconvert.emit(convert)
this gives results like for example:
cord clicked is (355, 132)
hex clicked is (3, 11)
unit is moved to (352, 144)
My problem now is that the unit is moved to a coordinate that is not within the hex i clicked.
hope this is clear