The Tags
property of the Hitbox
class provides access to a set of tags associated with the hitbox. Tags are useful for categorizing or identifying hitboxes within a scene, allowing for more flexible and organized management of game objects.
The Tags
property of the Hitbox
class provides access to a set of tags associated with the hitbox. Tags are useful for categorizing or identifying hitboxes within a scene, allowing for more flexible and organized management of game objects.
Use the Tags
property to add, remove, or check for specific tags on a hitbox. This can be particularly useful for filtering hitboxes during collision detection or when applying specific game logic based on tag presence.
// Example of using the Tags property on a Hitbox Hitbox hitbox = new Hitbox(); // Add a tag to the hitbox hitbox.Tags.Add("PlayerHitbox"); // Check if the hitbox has a specific tag if (hitbox.Tags.Contains("PlayerHitbox")) { // Perform actions specific to player hitboxes } // Remove a tag from the hitbox hitbox.Tags.Remove("PlayerHitbox");