PhysicsBodyType BodyType { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The BodyType property of a PhysicsBody specifies the movement type of the physics body. It can be one of the following:

  • Static: The body does not move and is not affected by forces or collisions.
  • Keyframed: The body is moved by setting its position directly, often used for animated objects.
  • Dynamic: The body is fully simulated by the physics engine, responding to forces and collisions.

Note: If this body is networked and dynamic, it will return Keyframed on the client side.

Usage

To set the BodyType of a PhysicsBody, you can assign it one of the values from the PhysicsBodyType enumeration. This will determine how the physics body behaves in the simulation.

Example usage:

PhysicsBody body = new PhysicsBody();
body.BodyType = PhysicsBodyType.Dynamic; // Set the body to be dynamic

Example

PhysicsBody body = new PhysicsBody();
body.BodyType = PhysicsBodyType.Dynamic; // Set the body to be dynamic