This error kept troubling me for about 2 hours now... I'm making an idle game where you can have your own city and I'm making a building system right now, the problem is the game crashes whenever I delete from array (I have build queue which holds buildings to be built and then removes them) building from build queue. I tried .shift
.pop
.push
.indexOf(0) === 0
and [0] === ""
and .splice(1,1)
it just comes up with like .splice is not a function or .pop is not a function for all of them.
Nothing worked. Please HELP!
if (buildValue === 100 && buildQueue.indexOf("house") === 0){
populationmax++;
// here i need a command that will remove first element from array called buildQueue.
buildValue = 0;
}