The Bodies
property of the PhysicsGroup
class provides access to all the physics bodies that are part of this physics group. This property returns an IEnumerable<PhysicsBody>
, allowing you to iterate over each PhysicsBody
within the group.
The Bodies
property of the PhysicsGroup
class provides access to all the physics bodies that are part of this physics group. This property returns an IEnumerable<PhysicsBody>
, allowing you to iterate over each PhysicsBody
within the group.
Use the Bodies
property when you need to perform operations on each physics body within a PhysicsGroup
. This can be useful for applying transformations, forces, or other physics-related operations to all bodies in the group.
// Example of iterating over all physics bodies in a PhysicsGroup PhysicsGroup physicsGroup = new PhysicsGroup(); foreach (PhysicsBody body in physicsGroup.Bodies) { // Perform operations on each body body.ApplyForce(new Vector3(0, 0, 10)); }