string Name { get; set; }

robot_2Generated
code_blocksInput

Description

The Name property of the InputAction class represents the identifier for the input action. This identifier is used in conjunction with input methods such as Input.Down, Input.Pressed, and Input.Released to determine the state of the input action.

Usage

The Name property must be a string that matches the regular expression pattern ^[a-zA-Z0-9_\-]+$. This means it can only contain alphanumeric characters, underscores, and hyphens. It is important to ensure that the name is unique within the context of your input actions to avoid conflicts.

Example

// Example of setting the Name property for an InputAction
InputAction jumpAction = new InputAction();
jumpAction.Name = "Jump"; // Valid name

// Using the Name property in input checks
if (Input.Pressed(jumpAction.Name))
{
    // Execute jump logic
}