Description
The PhysicsGroup
property of a PhysicsBody
represents the physics group to which the body belongs. A physics group is a collection of physics bodies that are logically grouped together, often for the purpose of managing interactions or applying collective operations.
Usage
Use the PhysicsGroup
property to access or modify the group association of a PhysicsBody
. This can be useful when you need to manage multiple physics bodies as a single unit, such as when applying forces or constraints that affect the entire group.
Example
// Example of accessing the PhysicsGroup property
PhysicsBody myPhysicsBody = new PhysicsBody();
PhysicsGroup myGroup = myPhysicsBody.PhysicsGroup;
// Example of setting the PhysicsGroup property
PhysicsGroup newGroup = new PhysicsGroup();
myPhysicsBody.PhysicsGroup = newGroup;