How to get the amount of variables in an array

Godot Version

Godot 4.2.2

Question

I’ve got a massive array in my project, and I don’t want to count how many things are in it. How to I get the number of things in an array?

name of the array, then .size() will get the size.
If you want to access something from within the array, using size as a value (like from 0 to size, pick a random thing), make it size - 1. Size() counts gives first entry the value 1 while arrays gives it 0

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.