move_to() function

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

me and my friend are making a game with a combat system close to pokemons. so I was wondering if there was a function that takes x,y cordnates and moves a character to said cordnates.if not is there a way to do it

:bust_in_silhouette: Reply From: abelgutierrez99

Hello!
There are two solutions depending on what you want:

  • Inmediate change: just code node.translation = newTranslation
  • Read interpolation in Godot and learn how to do
    I’m sorry if I don’t develop code here, but you can visit documentation.

Thanks for the help but it’s not what I’m looking for

cobracon | 2021-07-31 18:14

If you are looking for a built-in function to do so, I don’t know if it exists. With the documentation above you should be able to create yours according to your expectations. Otherwise, you can edit your question and add more information. Also lerp function might be useful, see here

abelgutierrez99 | 2021-07-31 18:22