Hi, if I have a PoolVector2Array and I only want a for loop using the first 2 vector setting. How could I code that. For example, I have many spawn positions in a PoolVector2Array, and I want different enemy be spawn at different position. However, the array[0,1] is not recognised by the editor, if some one could show what the right expression is, that would be helpful, thank you.
var enemyPosition =PoolVector2Array( [ Vector2(364,-496), Vector2(627, -496), Vector2(627,-353)])
func set_spawn_enemy (spawnPosition, spawnType):
for i in (spawnPosition):
var enemy
enemy = (spawnType).instance()
enemy.position = i
$YSort.call_deferred("add_child",enemy)
func _on_Hotspot_body_entered(body):
if body.name == "Player":
set_spawn_enemy(enemyPosition[0,1], enemyTypeA)