How to use Vector2 move_toward? #SOLVED

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By alanzulwas

Its a dump question, but i dont get it how to use vector2 move_toward

:bust_in_silhouette: Reply From: Bot7

I think that can help you

i have watch this. but this is not code what i want

alanzulwas | 2020-12-30 06:22

but thank you

alanzulwas | 2020-12-30 06:23

:bust_in_silhouette: Reply From: alanzulwas

I get the best answer. its …

# Moves to Vector(0,0) at a speed of 1 unit per second
var speed = 1 # Change this to increase it to more units/second
position = position.move_toward(Vector2(0,0), delta * speed)

so basically you are saying x and y you want to go to, and then the speed
the delta is … how many calculators/frames… (can’t remember which) but anyways it takes your speed / FPS to make it smooth