connected question...

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Sugor

How to instance for every count of an element inside an array? - Archive - Godot Forum this is the same i don’t know what happened…
This is how I make the arrays, I don’t know where i’m wrong

var elements = [1,2,3]
var contain_elements = []

func _physics_process(delta):
    _check_elements()

func _spawn_aqua_elements():
	for i in contain_elements:
		i = elements[1]
		var aquabo = contain_elements.count(i)
		if aquabo == 0:
			continue
			for x in range(aquabo):
				var aqua = preload("res://Entities/Player/Scenes/THREE/Aqua.tscn").instance()
				self.get_node("Elements").add_child(aqua)
				aqua.transform = get_parent().global_transform


if Input.is_action_just_pressed("aqua"): #WATER
	contain_elements.insert(contain_elements.size() , 2)

func _check_elements():
	if contain_elements.size() > 3:
		contain_elements.pop_front()
:bust_in_silhouette: Reply From: exuin

The continue keyword will skip to the next iteration of the for loop. That means that the inner for loop will never run. I think you have it indented one tab too much.