Component Hovered { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Hovered property of the PlayerController class represents the Component that the player is currently looking at. This property is useful for determining which object the player is interacting with or focusing on within the game environment.

Usage

To access the Hovered property, you need to have an instance of the PlayerController class. You can then retrieve the component that the player is currently looking at by simply accessing this property.

Example

// Example of accessing the Hovered property
PlayerController playerController = new PlayerController();
Component hoveredComponent = playerController.Hovered;

if (hoveredComponent != null)
{
    // Perform actions with the hovered component
    // For example, highlight the component or display information about it
}