ITagSet Tags { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Tags property of the PhysicsShape class provides access to the set of tags associated with the physics shape. Tags are used to categorize or label shapes for various purposes, such as filtering or identification during collision detection or other physics-related operations.

Usage

Use the Tags property to manage the tags associated with a PhysicsShape instance. You can add, remove, or check for specific tags using the methods provided by the ITagSet interface.

Example

// Example of using the Tags property
PhysicsShape shape = new PhysicsShape();

// Add a tag to the shape
shape.Tags.Add("Player");

// Check if the shape has a specific tag
bool hasPlayerTag = shape.Tags.Contains("Player");

// Remove a tag from the shape
shape.Tags.Remove("Player");