Description
The Renderer
property of the PlayerController
class provides access to the SkinnedModelRenderer
component associated with the player's body. This component is typically a child object of the player and is responsible for rendering the player's skinned model, which includes animations and visual representation.
Usage
To use the Renderer
property, you can access it directly from an instance of PlayerController
. This allows you to manipulate or query the SkinnedModelRenderer
component, such as changing the model, updating animations, or modifying rendering properties.
Example
// Example of accessing the Renderer property
PlayerController playerController = new PlayerController();
SkinnedModelRenderer renderer = playerController.Renderer;
// Example of using the Renderer to change the model
renderer.Model = newModel;
// Example of updating animation
playerController.UpdateAnimation(renderer);