Skip to main content

Tags ^.^

Small Tip...

Something that has been helpful to me is tags. What you do is set a game objects tag to something specific, to access them easier in a script. To set a tag, simply select the game object and in the inspector pane, click and select =D that easy.
















You can also create tags. While setting a tag click the add tag button. That easy.

So accessing a tag in a script is done something like this..

if(transform.tag == "Player"){
    attack();
}

I guess that would be something for an enemy script...

Anyway. You can assign the tag to as many objects. 

Comments