Can't you add tags using a script instead of tagging it through the editor ?

I was working on my project and thought that it would have been great if I could.
Is there any way to add a Tag to a game Object through a script?

@shahriar002

Of course even if an object is set as untagged that is still a tag. So it is as simple as referencing your gameObjects tag and setting it equal to a tag but I think you have to do something about creating the tag you are adding to the gameObject. All I know is you can force add an already existing tag. So an example of what I am saying is this:

gameObject.tag = "CoolObject";

But the tag “CoolObject” would have to exist in the editor in order to add it to the gameObject.
I will look more in to it now.

So your question is a copy and there is quite a few like it so I will send you to one with an answer that works and has been tested. Please try not to post a question that already has an answer:
ThePostWithYourAnswer
Cheers :smiley: