playMaker

Author Topic: [SOLVED]prefab can only create 1 game object  (Read 1088 times)

Dustiwi

  • Playmaker Newbie
  • *
  • Posts: 28
[SOLVED]prefab can only create 1 game object
« on: January 26, 2022, 07:49:39 PM »
Hello again, im trying to make my enemies spawn coins upon being destroyed, i made a prefab of the coin which i called "bit" made it into a global variable and set the game object like i was taught, it works fine but only once, i tried having a state that creates the coin each time, but that only seems to happen once. i also added the coin spawner to the enemy prefab so all enemies spawn the coins, but only one enemy can spawn the coins, same as with the other test i made, basically the coin can only be created once, dont really know what im missing ._.
« Last Edit: January 27, 2022, 12:31:34 PM by Dustiwi »

Stain Corb

  • Junior Playmaker
  • **
  • Posts: 74
Re: prefab can only create 1 game object
« Reply #1 on: January 27, 2022, 09:24:34 AM »
Hi Dustiwi.

Can you share a screen of the set up you built to get a better idea of what is wrong. ?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: prefab can only create 1 game object
« Reply #2 on: January 27, 2022, 10:07:25 AM »
Hi.
For this you should look into Pooling.
Create/destroy are heavy to cpu and leave lots of 'Garbage'

You can find a simple pool system on the ecosystem called : Pooler
Or
Look for 'pool playmaker' on the Asset store.
there are some that have pm support.

I use Lean Pool but i does not have playmaker support by itself.
But i do have playmaker action for it on my 'Third party asset actions for PlayMaker'

Dustiwi

  • Playmaker Newbie
  • *
  • Posts: 28
Re: prefab can only create 1 game object
« Reply #3 on: January 27, 2022, 12:31:01 PM »
tried the pooler package and it works nice, its exactly what i need thank you so much :D