playMaker

Author Topic: Pool Manager Setup  (Read 1302 times)

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Pool Manager Setup
« on: September 24, 2014, 05:38:08 AM »
Hi! So I'm in the process of setting up pool manager for optimization. The documentation seems really straight forward, but things aren't working and I can't seem to figure out why.

Can anyone shed a light on this? I feel like I'm missing something trivial

Here's what I have:

SpawnPool Script on Gameobject, Pool called "Bullets", with 50 bullet prefabs
Spawn script, referencing "Bullets" and the bullet prefab
DeSpawn script on the bullet game object, referencing "Bullets" and the bullet prefab

What works:
- In runtime I can see all the bullets disabled and parented to the GO where the SpawnPool script was attached

What doesn't:
- Spawning a bullet creates a new clone in the pool, instead of using one of the disabled ones
- DeSpawning a bullet doesn't do anything, error says it wasn't found

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 586
    • View Profile
    • Car and Traffic Playmaker assets
Re: Pool Manager Setup
« Reply #1 on: September 24, 2014, 06:15:27 AM »
Hi, looks all good, same setup for me..

One thing I read in other thread was not to use the cyrcle icon to pick the Prefab from the list, instead just drag and drop from folder, same for Spawn actions.
Another thing, try naming poll containing GO same as the pool.

Mayybe these wierd things help :D

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: Pool Manager Setup
« Reply #2 on: September 24, 2014, 09:47:07 AM »
thanks, I tried that now but it didn't make a difference unfortunately

mweyna

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Re: Pool Manager Setup
« Reply #3 on: September 24, 2014, 03:48:50 PM »
In my experience, the Spawn option tends to create a new pre-fab rather then active an old one. The pre-existing object is great if you're just going to enable/disable those existing objects and want to front-load that load time. (Say if you're gonna build a block castle on start). There should be a definite perform difference over the normal Unity Create actions, but really if you're spawning a large number of these over a quick period of time, you'd want to invest in particles over mesh objects.

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: Pool Manager Setup
« Reply #4 on: September 24, 2014, 03:52:04 PM »
Actually now I think I have a weirder problem, I checked out the example scene and everything is working there.

So I took the exact same action logic and used it on my actual game's scene, from the same project, and there it didn't work.

So something there is conflicting with Pool Manager in my scene but will be tricky to figure out what

Heres a pic, no reason why it should fail