playMaker

Author Topic: Trouble with never ending level generation...  (Read 1352 times)

ShazBang

  • Playmaker Newbie
  • *
  • Posts: 33
Trouble with never ending level generation...
« on: May 31, 2016, 06:15:45 AM »
Alright so I'm having a go at making one of those arcade never ending mobile games and it's going alright so far, just having an issue with spawning the ground.

So the ground spawns in chunks, like pillars that the player has to hop across, they're a parent object made up of a bunch of smaller objects such as the pillar, the trigger which, when entered will spawn another pillar infront and the spawn object, which is used as the location to spawn the next pillar, it is placed infront of the pillar.

The problem I'm having is when a pillar is spawned, it is spawned at all the spawn objects that exist, since it is a prefab and they are all duplicates of each other. The pillars are destroyed once off screen but it still means there are always at least two on screen.

What should I do? I don't think there is any way to do this other than making the spawn objects unique, so that once the pillar was spawned, you deleted the previous pillar's spawn so that it is no longer active, and the cycle just repeats.

Maybe adding an FSM to the prefab itself might work, I'll keep playing with it and try to figure it out, help would be appreciated though!  ;D