removing something from an array

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By leefinn
:warning: Old Version Published before Godot 3 was released.

Hi,

I have an array that needs to be randomized, and after “x” is called I want to remove it from the array. How can I do this?

Thanks :slight_smile:

Do you want to pick and remove a random item out of a randomized array?
Or do you just grab and remove the first or last item of a randomized array?
I would recommend you to do the later, because then you could use Array.pop_*().
In the first case you could use Array.erase(val)

atze | 2016-04-08 22:02

:bust_in_silhouette: Reply From: vonflyhighace2

I’ve actually asked a similar question not too long ago. Hope it helps :slight_smile: