Referencing a Collider2D

Hi folks.

I have a multi-objects scene controller (script that can control any objetcs in scene). It works fine, but for collisions I have to attatch the script to my player object. Problem? If the player dies (destroyed and regenerated prefab), items in the scene are inaccessible to the player.

The solution can be to attatch the script on the map (gameobject) and gives to it a Player object with player Collider2D. But… I haven’t any idea to do this.

You might look into the OnDestroy and Awake functions. In those, for the player, you could register the player’ collider with the manager when created and unregister when destroyed.