playMaker

Author Topic: (Solved) Delete Object or De-activate Object ?  (Read 1270 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
(Solved) Delete Object or De-activate Object ?
« on: November 10, 2018, 01:40:38 PM »
Hi !

For my endless runner game, I use Pooler from Ecosystem Browser and it is awesome. Now, despawning. I couldn't figure out how to do it here with Pooler.

So, I created a Box trigger on ground. On Trigger exit (Tag : Player), Object will be disabled / destroyed after 0.5 Seconds.

Which one is best for CPU performance ? Destroy or De-activate ?

Pooler will spawn 60 pieces of ground tile for every level.

Thanks.
« Last Edit: November 11, 2018, 06:27:34 AM by heavygunner »

GonerGames

  • Junior Playmaker
  • **
  • Posts: 53
Re: Delete Object or De-activate Object ?
« Reply #1 on: November 10, 2018, 03:25:53 PM »
Best is to use the Pooler Destroy Self action. This will deactivate the object and make it available to the pooler.

On the ground prefab you can have a wait time (2-3 seconds) then fire the Pooler Destory Object State. Less overhead then checking to see if it hit/exited a collider.

For obstacles:
You can add a global event to fire the Pooler Destroy object state directly. This way you can clear all the obstacles at once and put them back in the pool. This was used this for a "watch the ad and revive" mechanic.

Hope this helps.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Delete Object or De-activate Object ?
« Reply #2 on: November 10, 2018, 03:59:13 PM »
Hi.
What i do is, have a box trigger behind the player, off screen and far enough so the floor don't disappear below his feet.

and indeed as GonerGames said you should use Pooler Destroy Self so the can be reused again by the pooler