Search Unity

TileMap gameObject randomly destroying itself?

Discussion in 'Scripting' started by Emolk, Nov 21, 2019.

  1. Emolk

    Emolk

    Joined:
    Feb 11, 2014
    Posts:
    241
    Not sure what to put here tbh. I haven't touched my tilemap in ages. Now all of a sudden the Tilemap gameobject is destroyed randomly between 2-15s after i run the game in the inspector? Sometimes it is destroyed, sometimes it isn't? It appears to be totally random.

    The 'Grid' object itself doesn't get deleted, only the 'Tilemap' object.

    EDIT: Foolishly i misplaced a function call in my ontriggerevent. So when an enemy attack hit a block, it destroyed the tilemap. Instead its meant to destroy a vase on collision. Mystery solved.
     
    Last edited: Nov 21, 2019