Is it possible to limit the editor input ranges for exported Array size? For example if I use:

export(Array, int, 1, 10) var my_array

the integer values inside the array in the Inspector are limited from 1 to 10, but I do not know if there is a way to limit the range of the size of the array that contains the integer.

I don't think there is a way to limit the size of an exported array through the export flag, but you could probably limit the array size using a setget function:

export (Array, int, 1, 10) var my_array setget set_my_array
const MAX_ARRAY_SIZE = 10

func set_my_array(new_value):
	my_array = new_value
	if (my_array.size() > MAX_ARRAY_SIZE):
		my_array.resize(MAX_ARRAY_SIZE)

I have not tested the code above, but I think something like that should work for limiting the array.

Thank you, the code works well. The limit won't be apparent in the Inspector, but that's fine for me.

You can make the max array size itself a exported variable instead of a constant I suppose.

a year later