I have an extremely basic building spawn code that just gets the click position on the map and spawns a building at that location, irregardless of parenting it to the chunk it spawns on. The best part? This takes place in the _physics_process() of GameMap. I'm eventually going to have buttons in the UI to select which building to spawn, from there, buildings will spawn units, other than the first unit(s) of the game. What better ways of handling the spawning of buildings are there? I'd like to still get the position on and the ID of the chunk to be spawned on, but that can happen in the _physics_process() of any node, right? Should I focus on implementing the UI first, then handle the spawning code in that?
(Not looking for code) How should I be handling unit and building spawning?
what chunks are you talking about.
in my code if i needed to spawn items i would just crate a func wich spawns item and put it in unhandled input func, then check if button is pressed and call the spawn func. Then when the ui is done you just connect the button even to the input event or something..
To get positions, you could keep track of them by creating array/dictionary/list. Idk, im no cheese-tronaut so your millage may vary.
