This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+1 vote

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 (196 points)

1 Answer

+2 votes

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.

print(direction)

by (3,505 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 Frequently asked questions and 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 [email protected] with your username.