Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Syl |
Greets!
I got this code, thanks to @Bartosz:
extends Node2D
func _input(event):
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and event.pressed:
$Tween.interpolate_property($sprite, “global_position”,$sprite.global_position, get_global_mouse_position(), 1,Tween.TRANS_LINEAR,Tween.EASE_IN)
$Tween.start()
to make my sprite/player move toward a mouse click. But, trouble is, it’s movin faster the further the click is, and i want it to be at the same speed, wherever the mouse click.
What should i add in the script please?