Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Boris007 |
Sort on an array of Vector3 returns Nil.
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Boris007 |
Sort on an array of Vector3 returns Nil.
Reply From: | jgodfrey |
sort()
is a void method, so it doesn’t return anything. Instead, it directly sorts the array it’s called on. So…
your_array.sort()
… 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.