Component Pressed { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Pressed property of the PlayerController class represents the component that the player is currently interacting with by holding down the "USE" button. This property is useful for determining which object the player is actively using or manipulating in the game environment.

Usage

To access the Pressed property, you need to have an instance of the PlayerController class. This property is read-only and returns a Component that the player is currently using.

Example

// Example of accessing the Pressed property
PlayerController playerController = new PlayerController();
Component currentPressedComponent = playerController.Pressed;

if (currentPressedComponent != null)
{
    // Perform actions with the currently pressed component
    // For example, display a message or trigger an event
}