playMaker

Author Topic: How to spawn a random object using pool manager/playmaker?  (Read 14487 times)

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: How to spawn a random object using pool manager/playmaker?
« Reply #15 on: May 23, 2014, 02:08:24 PM »
The flexibility of Playmaker is that it allows you to create complex code situations without any knowledge of how to code. If I had to wait for someone to create specific project code that I needed I'd never have made any progress on my project. Is it the most efficient way to handle it versus "true programming?" absolutely not. Can you solve these sort of problems without any additional code support, yes. At the end of the day, no one will care about your project or programming needs more then you. Better to develop the habit as much as possible now to solve your issue (even if it isn't the most effective way), and then if someone creates something easier to use that.

PaulH

  • Junior Playmaker
  • **
  • Posts: 50
Re: How to spawn a random object using pool manager/playmaker?
« Reply #16 on: May 23, 2014, 03:30:47 PM »
The flexibility of Playmaker is that it allows you to create complex code situations without any knowledge of how to code. If I had to wait for someone to create specific project code that I needed I'd never have made any progress on my project. Is it the most efficient way to handle it versus "true programming?" absolutely not. Can you solve these sort of problems without any additional code support, yes. At the end of the day, no one will care about your project or programming needs more then you. Better to develop the habit as much as possible now to solve your issue (even if it isn't the most effective way), and then if someone creates something easier to use that.

you shouldn't have to find crazy workarounds(and in this case there wasnt one, yours didnt work for me). playmaker isnt cheap, i feel the least they should do is try to have the actions for any scenario, or someone on standby ready to write them if not.

"Artists and Designers: Realize your creative vision without coding! Unlock the power of Unity. "








playmaker is all about the actions obviously,

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to spawn a random object using pool manager/playmaker?
« Reply #17 on: May 26, 2014, 04:03:16 AM »
Hi,

Ok, I think you are overthinking this.

If you study the action "Pmt Spawn", you'll see that it expects the name of the pool and a reference to a prefab. So basically, your random pick of the prefab you want to spawn has to be done before you call this action.

 I assume the following:

 you have a "spawn pool" name "My Multi Pool" in your scene

in "My Multi Pool", you have created several "per prefab" pool, and each reference a different prefab

use "Select Random GameObject" and list the very same prefabs you used in "My Multi Pool"

Inject the gameobject randomly picked by "Select Random GameObject" action nad use that in "Pmt Spawn" referencing the pool "My Multi Pool".

 that's it.

 Does that makle sense? give it a go, if that doesn't work out, I'll do a working example. You don't need any custom actions, you don't need ArrayMaker. You would need arrayMaker if you want to have more control over the list of prefabs you may randomly pick.

 Now. I can see a potential new custom action that would pick a random per prefab pool item declared in a "spawn pool", so that it would be more intuitive, but it's totally possible without as I explained above.

 Bye,

 Jean
 
« Last Edit: May 26, 2014, 04:06:46 AM by jeanfabre »