How can I replace an object while keeping the references to that object?

Basically I have a player character object and when the player hits a button I want to replace that character object with a different character object. I have that working fine with this code:

spawnposition = GameObject.FindWithTag("player").transform.position;
Destroy (GameObject.FindWithTag ("player"));
GameObject newplayer = Instantiate(prefabtospawn, spawnposition, transform.rotation) as GameObject;

However, I have a camera and certain enemies whose movement is based on the player character and they have references to the player character set up as such:

_playerposition = GameObject.FindGameObjectWithTag("player").transform;

So when I execute the first set of code above, it works as intended, getting the correct spawn position, killing off the old object, spawning the new one, but then of course I get error messages because the camera / enemies are trying to access the old player position and that object no longer exists.

I’m not really sure what to do about this. I figure that I either…

A. Instead of killing the original object and creating a new one, just switch it out somehow (is this even possible?)

Or if that isn’t possible…

B. Find all references to the old object and set them to the new object. No idea how to do this though.

What would be the best way to handle this and where would I start?

Why not instantiate your characters as children of the object that your enemies know about then you can destroy and create what you like and the reference will remain the same.

You can also just change the texture of your Player, assuming you are using a Sprite/unity2D.
If its a 3d model, make the “player” as an empty gameObject, and make the character that represents your player a child of this “player”.

So,
player-Handles all interactions
Player-child- Is the actual character which you would be switching out at runtime