First and foremost i’m prototyping a 2D Platformer and i’ve just started with the checkpoint mechanics. The way i’m handling checkpoints and world resets is that i made an object that acts as a CheckpointManager and i simply won’t destroy it when the player resets because of dying, this object also handles spawning the player in the right place.
So far so good, what i think might be a bad practice is the way i’m accessing this object/script, i’d like some feedback and if there’s a better way to access it.
checkpointManager = GameObject.Find ("Checkpoint Manager").GetComponent<CheckpointManager>();
This is how i do it, but this means i’ll always have to look for it as a GameObject and since i have quite a few of them when it expands even further it might affect the performance.