0 votes

Sort on an array of Vector3 returns Nil.

Godot version 3.2
in Engine by (14 points)

1 Answer

0 votes

sort() is a void method, so it doesn't return anything. Instead, it directly sorts the array it's called on. So...


... will directly sort your_array.

That said, I'm not sure what it'll do with a an array of Vector3. If it doesn't do what you want / expect, you may wan to to use sort_custom() instead.


by (13,682 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.