For background i am making a space imperium game with planets and fleets.
I have a GameObject Fleet that has a FleetScript.boo component.
This FleetScript.boo has a
[SerializeField] fleetNumber as int
[SerializeField] startFleetShips as (GameObject) = array(GameObject, fleetNumber)
that i am forced to use since lists don’t show up in the inspector and i want to add ships to my GameObjects fleets before game start.
So to this startFleetShips array in the inspector i add lightAttackShipPreFabs.
In the Start() function i convert the startFleetShips to a List so i can add and remove ships.
But when i create GameObjects with the code fleetShips = [Instantiate(item) for item in startFleetShips ]
these gameObjects appears in the Hierarchy as independent GameObjects instead of children to the Fleet GameObject.
I know this might be messy to understand but i really don’t get it why they can’t appear right.
When i do fleet combat it all works, when i destroy a ship the correct ship gameobject dissapears.
But it is just that the ship GameObject don’t visual in the Hierarchy appears under the Fleet Gameobject which i think it should.
And this is a problem becouse it gets visual messy if the ship GameObjects can’t stay under their Fleet GameObject in the Hierarchy. With lots of fleets i am gonna have the Hierarchy spammed with ship GameObjects.
Anyone got any ideas or solutions?