Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: heavygunner on September 28, 2018, 12:52:45 AM
-
Hi !
See screenshots. I will spawn 10 grounds like this and 20 red bricks will be spawn in different gaps.
Game win when player jumped all over bricks.
Should I write a FSM to delete the ground object after player passed few distance. or shall I leave it? Will leaving it will cause device lag?
Thanks
-
Only creating and destroying will cause stuttering, so either use pooling to recycle bricks (which i recommend) or leave them be if they are standing there doing nothing.
Since the bricks are just empty objects with no variables to reset, pool all the way.
-
Hi.
Indeed pooling is a good option and / or you can reuse the brick to place in front
(offscreen)
-
Thank you for the inputs.
I used "Pooler" from Ecosystem browser and did this.
After created pool, I put 5 sec wait time to see the function. Please check this short video and let know whether I did right or not.
Screen record (59 Secs) :
Thanks 8)
-
Hi.
Looks good.
Now you need to make a setup to despawn then block when it is off screen behind the player.
There are a few ways to do this,
One for example is :
Have a trigger offscreen behind the player and when a 'ground' object hits the trigger despawn it :)