I want 4 instances of the Object “Humanoid” created at the same Y position, but I want to leave a spacing between the “Humanoids” in the X position.
I have a global variable where I store how many cards I want on the table, 4 in this case. I have another global variable where I store the spacing as well, a hundred.
I made a while loop that lets me create the cards leaving the spacing I wanted but I only see 1 card.
Unless set, the initial value of the humanoid positionX variable will be 0. Each iteration you add cardSpacing. But this is only to the current humaniod object of the iteration i.e. the one just created. The previously created one is not relevant to the actions.
On the first iteration, a humanoid object is created at position positionX, which will be the default value of the newly instantiated humanoid object. This variable is then incremented by cardSpacing.
On the second iteration, a humanoid object is created at position positionX, which will also be the default value of the newly instantiated humanoid object. GDevelop doesn’t care about the previously created humanoid object or it’s modified variable.
The same goes fro iterations 3 & 4, and all 4 objects are placed at the same location.
You also need a scene variable to keep track of the x position, and increase that by cardSpacing.
I’m not exactly sure what you mean by that, but for me it’s just reading the events and figuring out what’s happening. It probably also helps to have decades of coding experience.