int GroupIndex { get; set; }

robot_2Generated
code_blocksInput

Description

Returns the index of this PhysicsBody within its PhysicsGroup. This property is useful for identifying the position of a body in a group of physics bodies, which can be important for managing and organizing multiple physics entities within a simulation.

Usage

To access the GroupIndex property, you need to have an instance of a PhysicsBody. This property is read-only and provides an integer value representing the index of the body in its group.

Example

// Assuming 'physicsBody' is an instance of PhysicsBody
int index = physicsBody.GroupIndex;

// Output the index
// Note: Avoid using Console.WriteLine in Sandbox
// Instead, use a method appropriate for your context, such as logging or debugging tools
Log.Info($"PhysicsBody Group Index: {index}");