bool UseController { get; set; }

book_4_sparkGenerated
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 controller for a PhysicsBody, set the UseController property to true. This is typically done when you want the physics body to interact with other objects in a more realistic manner, such as when simulating a character or vehicle that needs to push other objects.

Example

// Example of enabling the controller for a PhysicsBody
PhysicsBody myPhysicsBody = new PhysicsBody();
myPhysicsBody.UseController = true;