PlayerController Controller { get; set; }

robot_2Generated
code_blocksInput

Description

The Controller property of the MoveMode class provides access to the PlayerController associated with the current movement mode. This property is essential for managing and interacting with the player's movement and behavior within the game environment.

Usage

To use the Controller property, you must have an instance of a class that derives from MoveMode. The property is read-only and provides access to the PlayerController component, which is required for the movement mode to function correctly.

Ensure that the PlayerController component is attached to the game object using the RequireComponent attribute, which enforces the presence of the necessary component.

Example

// Example of accessing the Controller property in a derived MoveMode class
public class CustomMoveMode : MoveMode
{
    public override void OnModeBegin()
    {
        base.OnModeBegin();
        // Access the PlayerController through the Controller property
        PlayerController playerController = this.Controller;
        // Perform operations with the playerController
    }
}