playMaker

Author Topic: Multiple Object Spawning  (Read 1203 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Multiple Object Spawning
« on: January 06, 2019, 05:12:49 AM »
Hi !

I have 20 spawn points created on my sample map. I have 20 gameobjects to spawn. Everytime game loaded, objects should spawn on spawn points. Not in any order, but randomly.

Problem is, in most case, 2 or more objects spawning on single spawnpoint.

I just wanted to spawn a random gameobject from pool in one spawnpoint only.

How to do it ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Multiple Object Spawning
« Reply #1 on: January 06, 2019, 09:50:47 AM »
Hi.
Place your spawn points in an array, then use 'array get random' and store the spawn point and also the index.

then use 'Array Delete At' as use the index there.

if you want to reuse you can first copy the array and then use the other one.