Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Neikke on June 14, 2019, 05:40:48 AM
-
I have a pool of 10 objects (text prefabs) which I want to be able to activate one by one on each collision with Player.
So obviously I will have a pool of 10 instantiated at the start, but deactivated objects waiting to be activated on collision with player. But then how would I:
1. Activate them one by one without activating all 10 at once?
2. Activate only deactivated ones?
Please help!
-
Hi.
use an Array, set size to 10 so you can drop in the objects.
drop in all the objects in element 0 place the 1st one that should be activated and in element 9 the last on (and rest in between)
You can loop by using 'array get next'.
Or you could use an int starting @ 0 and on hit get array (use the int on the index)
enable the object and do int add 1 to the int value.
or an action called Iterate.
here's a video about arrays :
-
OK, thanks a lot man!