HI Everyone,
I'm trying to add a Sprite2D node to a C# list. The code below shows now errors and builds, but the loop dies on the first iteration:
var coinSprites = GetNode<Node2D>("CoinSprites");
List<Sprite2D> coins = new List<Sprite2D> { };
foreach (Sprite2D coin in coinSprites.GetChildren())
{
coins.Add(coin);
}
Any ideas welcome!
And, if this really just a bad idea in general, and there's a better way to move some sprites into an array or list, please let me know 🙂