Search Unity

How to force spawner to reset Prefab to it's initial state?

Discussion in 'Prefabs' started by Neikke, Jun 5, 2019.

  1. Neikke

    Neikke

    Joined:
    Jun 23, 2017
    Posts:
    72
    Guys, please help! I'm using More Mountain's Infinite Runner engine and latest PlayMaker. So here's the situation:

    I have a spawner which spawns 1 out of 5 platforms in random order, and sends them towards my player character, one after another, simple as that.

    On each of those prefab platforms I have Coins which I force to be activated from the start in FSM. Then Player collects Coins by colliding with them, sending add +1 to Coins manager and finally deactivating the coin. Also very simple.

    Everything's working nice and correctly for some time, but after a while, my platforms start spawning with almost no coins, or only a few of them. As I understand it, it happens because at some point at runtime Unity starts to think that the Platform with No coins - is the Original one and continues to spawn it instead of the one with untouched Coins!

    Did anyone experience anything like this? Forcing Activation of those coins didn't help. Platforms keep spawning already deactivated.

    Any help or advice is much appreciated!