bool UseController { get; set; }

robot_2Generated
code_blocksInput

Description

The UseController property of the PhysicsBody class determines whether a controller is created for the physics body. When set to true, a controller is created, which is particularly useful for keyframed physics objects that need to interact with other objects by pushing them. The controller ensures that the entity sweeps through space as it moves, rather than teleporting, which provides more realistic interactions with dynamic objects.

Usage

To enable the use of a controller for a PhysicsBody, set the UseController property to true. This is beneficial when you want the physics body to interact with other objects in a more natural manner, especially when the object is keyframed and needs to push other dynamic objects.

Example

// Example of enabling the UseController property
PhysicsBody myPhysicsBody = new PhysicsBody();
myPhysicsBody.UseController = true;

// This will create a controller for the physics body,
// allowing it to sweep through space and interact with other objects more naturally.