Hi.
I don't have 'More Mountain's Infinite Runner engine' so i am not sure how they pool things.
But normally if they get disabled and the fsm as well, on enabling again the fsm should restart from the 'start' transition(unless setting was changed on the fsm tab), BUT variables are not reset.
So what i do with something like this is :
On start state Disable all coins and set all variables to its default value i want it to be.
Next state Enable Random coins
But from what you have written i think you are already doing something like that.
So i think best is to find out if the fsm gets disabled or not.
Hi, the thing is I'm not deactivating FSMs, they're always there. And I even have
Activate Game Object action in the
Start node. Actually it's not only Coins I have troubles with, I experience the same problems with not going back to original state even on simplest animated objects. For example I have a few trees that have falling to the ground animation, and they work fine (resetting in the beginning) only for 4 or 5 spawn rounds, after that, all consequent platforms start spawning with fallen trees already..
MoreMountains creates a pool of your platform prefabs in the Spawn Manager. As you collect the coins from each spawned platform you are then deactivating the coins permanently using the Playmaker FSM. As the pool recycles the platforms it does not automatically turn the coins back on as it remembers that you have deactivated the coins.
To get around this:
Make a Empty Game Object "Coin Holder"
Drop your collectable coin into the Coin Holder as a child
On the Coin Holder make an FSM with:
- State 1: Wait 0.1 -> go to state 2
- State 2: Activate collectible coin object
Now when the platform reactivates the FSMs on the Coin holder will run and reactivate the collectible coins.
By also having the collectable coin as a child of the Coin Holder it is also easy to reset the position of the collectable coin if needed. Eg. Magnet power up that pulls the coins towards you therefore needing a reset of the coin position for next time.
This sounds interesting definitely, and though I do use parent gameobject similar to CoinHolder you mentioned, I have
Activate Game Object action right in the beginning Start State node of its FSM. Can you please tell me why do you suggest putting
Activate Game Object to the second state, and having to
Wait for 0.1 sec in the first
Start node? Why not re-activating all "deactivated" objects directly in the
Start node?
Thanks!