Assigning objects to an array of objects

Hey I’m currently facing the problem that I want to create an array of objects. In my case there should be an array of Miners. As it is not possible to directly assign the constructor to the array element I tried to solve it as shown in the picture. The problem here is that the array is currently empty and therefore it is not possible to assign the temporary object to the array.

What is the right way to assign objects to an array of objects?

You append an array (with the new element in it) to the array.

set Minors += array{TempMinor}

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.