0 votes

I've been testing this vector2 method and I don't see any changes and don't know how to use it.
can someone explain to me what its function is

in Engine by (183 points)

1 Answer

+1 vote

As the docs say here That method retunrs a vector with length 1 that points to the Vector in the argument. For example:

var start = Vector2(3,4)
var end = Vector2(5,5)

var direction = start.direction_to(end)
# will print (0.894427, 0.447214), as it is the normalized vector  
# that points to `end` vector, starting from `start` vector.


by (3,388 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.