B1 Intermediate UK 1466 Folder Collection
After playing the video, you can click or select the word to look it up in the dictionary.
Loading...
Report Subtitle Errors
Tags are a way of identifying game objects in Unity.
As a name of a single object could identify it,
it can be useful to set tags also.
For example you may have an object called Ork or Tank
but these could all be tagged Enemy,
and in your code you could check for any objects
that have the tag Enemy.
Likewise a script on an enemy could check for a player character
by looking for a player tag.
To assign a tag to an object, select it and use the
drop-down menu at the top of the inspector.
If the tag you want isn't already present then add a new tag.
You can add a tag by clicking the option at the bottom of the menu
and then entering it in the list of tags at the top
of the tag manager.
Once you've done this, return to the object you
wish to place the tag on
and select it from the drop-down.
There are a number of functions in code,
which will allow you to find objects with tags,
the simplest one of these is GameObject.FindWithTag,
which allows you to specify a string with the name
of the tag inside it.
This script is attached to my enemy object
and I can use that to find an object with the tag Player.
So I'll set my robot to be tagged Player
and when the game starts my enemy is seeking out that
object and looking at it.
Likewise you could find multiple objects with the same tag
by using FindGameObjectWithTag.
See the scripting reference for more examples of this.
    You must  Log in  to get the function.
Tip: Click on the article or the word in the subtitle to get translation quickly!

Loading…

Tags - Unity Official Tutorials

1466 Folder Collection
朱瑛 published on May 2, 2014
More Recommended Videos
  1. 1. Search word

    Select word on the caption to look it up in the dictionary!

  2. 2. Repeat single sentence

    Repeat the same sentence to enhance listening ability

  3. 3. Shortcut

    Shortcut!

  4. 4. Close caption

    Close the English caption

  5. 5. Embed

    Embed the video to your blog

  6. 6. Unfold

    Hide right panel

  1. Listening Quiz

    Listening Quiz!

  1. Click to open your notebook

  1. UrbanDictionary 俚語字典整合查詢。一般字典查詢不到你滿意的解譯,不妨使用「俚語字典」,或許會讓你有滿意的答案喔