Description
The Velocity
property of the PhysicsGroup
class is used to set the velocity of all physics bodies within the group. This property directly affects the Velocity
of each PhysicsBody
in the group, allowing for uniform motion control across multiple bodies.
Usage
To use the Velocity
property, simply assign a Vector3
value to it. This will set the velocity for all bodies in the PhysicsGroup
. For example, if you want all bodies in the group to move in a specific direction at a certain speed, you can set the Velocity
property to a Vector3
representing that direction and speed.
Example
// Example of setting the Velocity property for a PhysicsGroup
PhysicsGroup myPhysicsGroup = new PhysicsGroup();
// Set the velocity of all bodies in the group to move along the X-axis at a speed of 10 units per second
myPhysicsGroup.Velocity = new Vector3(10, 0, 0);