Get Tags
Retrieve all CollectionService tags attached to a Roblox instance. Tags are string labels used to categorize and query instances.Parameters
Roblox instance path using dot notation (e.g.,
"game.Workspace.Part")Response
Returns an array of tag strings:[] if no tags exist.
Example Usage
Get Tags on Instance
Check for Specific Tags
Audit Tags Across Multiple Instances
Use Cases
Tag-Based Systems
Query which systems an instance belongs to (e.g., weapon system, enemy AI, collectible system).Debugging
Verify that instances have correct tags for gameplay systems to function properly.Tag Inheritance
Check parent/child tag relationships when implementing tag-based behavior inheritance.Conditional Logic
Make decisions based on tag presence (e.g., if object has “Flammable” tag, apply fire damage).Tag Migration
Audit existing tags before renaming or consolidating tag systems.What are CollectionService Tags?
Tags are string labels managed by Roblox’sCollectionService. They allow you to:
- Categorize instances without using folder hierarchies
- Query instances by tag using
get_tagged - Apply behaviors to tagged instances in scripts
- Multi-categorize instances (one instance can have many tags)
Tags vs. Attributes
| Feature | Tags | Attributes |
|---|---|---|
| Type | String labels only | Multiple data types |
| Purpose | Categorization/grouping | Data storage |
| Query | Find all instances with tag | Must search manually |
| Count | Unlimited tags per instance | ~150 attributes per instance |
| Example | ”Weapon”, “Enemy”, “Collectible” | Damage: 50, Speed: 16 |
Integration with Tag System
Complete Tag Workflow
Performance Considerations
- Extremely fast operation (no hierarchy traversal)
- More efficient than calling
add_tag/remove_tagto test tag existence - Ideal for batch operations checking multiple tags
Error Handling
- Throws error if
instancePathis invalid or instance doesn’t exist - Returns empty array
[]if instance has no tags (not an error) - Tags are returned in arbitrary order (not alphabetical or insertion order)
Related Tools
Add Tag
Add a CollectionService tag to an instance
Remove Tag
Remove a tag from an instance
Get Tagged
Find all instances with a specific tag
Common Tag Patterns
Gameplay Systems
Enemy Classification
Team Assignment
Notes
- Tags are visible in Studio’s Properties panel under “Tags” section
- Tags are case-sensitive (
"Weapon"≠"weapon") - Tags replicate from server to client automatically
- Maximum tag name length: 100 characters
- Tags persist when saving the game file
- One instance can have unlimited tags (practical limit ~100)