they are 1287.643, wich are located in my mini map when clickin, right?
Yup!
Unfortunately this means its something else that is the problem, and I'm not sure what it could be. However, I do have a (potential) messy fix: Because it's only the first click that causes issues, just ignore the first click (and resend it)
It would look like this:
extends Node2D
var terrain_speed = 1.0
var speed = 50
var first_input = false
func _input(event):
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and event.pressed:
if first_input == false:
first_input = true
" Not sure if this will work."
Input.parse_input_event(event)
return
var map_pos = $Map/Sprite.global_position
var mouse_pos = get_global_mouse_position()
var distance = map_pos.distance_to(mouse_pos)
var duration = distance * terrain_speed/speed
" The picture does not show the tween calls fully, so I cannot write them here "
If sending the input event again does not work, then you could try changing it to this $Map/Sprite.global_position = get_global_mouse_position (just remove Input.parse_input_event(event) and replace it with the code)
Other than that, I'm not sure. I can try to debug the project if you zip it and upload it here, but without looking at the project I cannot say what the problem is, because I just don't know enough about 2D nodes / Godot in 2D.
Hopefully you'll find a solution (or someone who knows better than me will chime in :smile: )