Description
The Body
property of the PlayerController
class represents the Rigidbody
component associated with the player. This component is crucial for handling the physics interactions of the player within the game world, such as collisions and movement dynamics.
Usage
To access the Body
property, you need to have an instance of the PlayerController
class. This property is read-only and is automatically managed by the PlayerController
. It is typically used internally to apply physics-based operations on the player character.
Example
// Example of accessing the Body property
PlayerController playerController = new PlayerController();
Rigidbody playerBody = playerController.Body;
// Use the Rigidbody to apply a force
playerBody.ApplyForce(new Vector3(0, 10, 0));