bool WasClicked { get; set; }

robot_2Generated
code_blocksInput

Description

The WasClicked property is a static boolean property of the Gizmo class in the Sandbox namespace. It indicates whether the gizmo was clicked during the current frame. This property is useful for detecting user interactions with gizmos in a scene, allowing developers to respond to click events on gizmos.

Usage

To use the WasClicked property, simply access it directly from the Gizmo class. It returns a boolean value that is true if the gizmo was clicked in the current frame, and false otherwise.

Example

// Example of using the WasClicked property
if (Gizmo.WasClicked)
{
    // Perform an action when the gizmo is clicked
    HandleGizmoClick();
}

void HandleGizmoClick()
{
    // Logic to handle the gizmo click event
    // This could involve selecting an object, opening a menu, etc.
}