how can I tag a gameobject as Player at the start of a scene loading from the last?

I need to tag a gameobject the player selects from a character selection screen from the last scene in the next scene.

With assumption that you’re using default Unity UI buttons, you can use the OnClick function with a referenced script to change the player’s tag. The code would go like this; This includes referencing the player. I will show two separate functions giving the player different tags based on if they were selected or not.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TagScript : MonoBehaviour {

    //GameObject you want as player
    public GameObject Player;
    
    public void WarriorTag() 
    {
       Player.tag = "Warrior";
    }
    
    public void MageTag() 
    {
       Player.tag = "Mage";
    }
}

If you reference this script through the OnClick function and select the function representing the button, this should work fine. If you don’t know how to do this, comment below. This will tag the GameObject the player selects if there are UI buttons on the selection screen. If they are objects that are to be chosen, then different code will be needed.