Tag an gameobject at runtime after a condition completed

Hi, I want to change tag of an gameobject at runtime after a condition completed.
I use:
gameObject.tag = “Myothertag”;
but it doesnt work
How I can do fix it?
Thanks,

In this example, my condition works but the tag does not change.

void Update () {
		
		if (distance < 10 && distance > 0 && gameObject.tag == "Player" ) 
		
		{ 
			GetComponent<RawImage> ().texture = Disparition as MovieTexture;
			audio = GetComponent <AudioSource> ();
			audio.clip = Disparition.audioClip;
			Disparition.Play ();

			Avertissement.Stop ();
			Pose.Stop ();

			gameObject.tag = "Quit";
		
		}

@vauthier For changing the tag at run time you must add tag “Quit” in Tags list. First set tag “Untagged” and after condition completed gameObject.tag = “Quit” will work.
Thanks

@vauthier For changing the tag at run time you must add tag “Quit” in Tags list. First set tag “Untagged” and after condition completed gameObject.tag = “Quit” will work.
Thanks