0
0
Unityframework~5 mins

Tags and layers in Unity - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a tag in Unity?
A tag is a label you assign to a GameObject to identify it easily in your scripts. For example, you can tag all enemies with "Enemy" to find them quickly.
Click to reveal answer
beginner
What is a layer in Unity?
A layer is a way to group GameObjects for rendering and physics purposes. Layers help control which objects interact or are visible to cameras.
Click to reveal answer
beginner
How do you check a GameObject's tag in a script?
You use gameObject.CompareTag("TagName") or check gameObject.tag == "TagName" to see if it has a specific tag.
Click to reveal answer
intermediate
Why use layers for physics collisions?
Layers let you control which objects collide by setting collision rules in the Physics settings. This improves performance and game logic.
Click to reveal answer
beginner
Can a GameObject have multiple tags or layers?
No, a GameObject can have only one tag and one layer at a time. But you can create custom tags and layers to organize your objects better.
Click to reveal answer
What is the main purpose of tags in Unity?
ATo control rendering order
BTo group objects for physics collisions
CTo identify GameObjects easily in scripts
DTo change object colors
How many tags can a GameObject have at once?
ANone
BTwo
CMultiple
DOne
What is a common use of layers in Unity?
ATo control which objects collide
BTo assign textures
CTo name GameObjects
DTo write scripts
Which method is recommended to check a GameObject's tag in code?
AgameObject.GetTag()
BgameObject.CompareTag("TagName")
CgameObject.HasTag("TagName")
DgameObject.CheckTag()
Can layers affect camera visibility?
AYes, cameras can cull layers
BNo, layers only affect physics
CNo, layers only affect tags
DYes, layers change object colors
Explain the difference between tags and layers in Unity and give an example of when to use each.
Think about how you find objects vs how you control collisions or visibility.
You got /4 concepts.
    Describe how you would use layers to optimize physics collisions in a Unity game.
    Consider how layers can prevent unnecessary collision checks.
    You got /4 concepts.