Description
The Hitbox
property of the Gizmo
class provides a static interface for creating a gizmo hitbox. This hitbox is interactable using input devices such as a mouse or a VR deck2 super controller. It is part of the Sandbox.Gizmo
namespace and is used to define areas within the gizmo that can respond to user interactions.
Usage
To use the Hitbox
property, you can access it directly from the Gizmo
class since it is a static property. This property is typically used in scenarios where you need to define interactive regions within a gizmo for user interaction.
Example
// Example of using the Gizmo.Hitbox property
// Define a hitbox for a gizmo
var hitbox = Gizmo.Hitbox;
// Use the hitbox in your application logic
// For example, checking if the hitbox is interacted with
if (Gizmo.IsHovered)
{
// Perform actions when the hitbox is hovered over
}
if (Gizmo.WasClicked)
{
// Perform actions when the hitbox is clicked
}