direction_to() not working with vector2s.

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

it’s, mentioned in the wiki without any notes or warning so I would assume it should work just like does in 3d, and yeah I allready tried it in 3d, incredibly usefull and worked flawlessly, but it seems like the wiki is outdated and for some reason this function just doesn’t exist anymore for vector2s. that’s the error I get. “method ‘direction_to’ is not declared on vector2”

what the hell?

Which version of the engine are you using, and what’s the code that’s attempting to use direction_to()?

Ertain | 2019-12-07 19:07

3.1 “stable version” according to the executable’s name.
the code is just, position.direction_to(target_vector)
I was trying to fmove an object to a specific direction.
turns out I can to_local the position I was trying to move to and normalize it.
I’m not sure if that can replace the function in every situation, but it definitely helped me here.

zen3001 | 2019-12-07 19:43

:bust_in_silhouette: Reply From: zen3001

ahh, turns out I was using an outdated version of godot after all.
I was still using 3.1 instead of 3.1.2