> For the complete documentation index, see [llms.txt](https://mindcodeinteractive.gitbook.io/easy-build-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mindcodeinteractive.gitbook.io/easy-build-system/reference/building-controller/building-input.md).

# Building Input

Handles keyboard, mouse and gamepad input for building actions.\
Supports Legacy Input Manager and the new Input System.

***

### How Input Works

[Building Input](/easy-build-system/reference/building-controller/building-input.md) bridges the player's input and the [Building Controller](/easy-build-system/reference/building-controller.md).\
It reads validate, cancel, rotate, and select actions, then forwards them to the active state.\
It also handles mode switching and manages the part selection list for cycling.\
Both input backends coexist through compile-time directives.

With **Block When Pointer Over UI** on, building input is blocked when hovering over UI.\
This prevents accidental placements when clicking UI buttons.

***

### Input Bindings

The inspector adapts to the active input handling mode in your project's Player Settings.\
If set to **Input System Package**, the New Input System fields are shown.\
If set to **Input Manager (Old)**, the legacy key fields are shown.\
If set to **Both**, the New Input System fields are displayed by default.

**Validate**: Confirms the current building action.\
New Input System: `InputActionReference`. Legacy: `Mouse0`.

**Cancel**: Cancels the current mode.\
New Input System: `InputActionReference`. Legacy: `Mouse1`.

**Rotate**: Rotates the preview. Supports axis input (scroll wheel, thumbstick).\
Legacy: scroll wheel when **Use Scroll Wheel Input** is enabled.

**Select**: Cycles through available parts.\
New Input System: `InputActionReference`. Legacy: scroll wheel.

**Placement / Destruction / Adjustment Mode**: Direct mode switching.\
New Input System: `InputActionReference`. Legacy: `E`, `R`, `T`.

A default Input Action Asset at `Resources/Default Input Actions` is auto-assigned on reset.

***

### Direct Controls & Part Selection

When **Enable Direct Controls** is checked, the input handles mode switching and part cycling.

When **Use Custom Parts Selection** is enabled, input uses a custom list of part prefab IDs.\
This list can be populated manually or using a [Building Collection](/easy-build-system/reference/building-collections.md).

The select action cycles through the list and calls `BuildingController.SelectPart()`.

***

### Scripting Examples

Access the input component:

```csharp
BuildingInput input = BuildingController.Instance.BuildingInput;
```

Check if input is blocked by UI:

```csharp
// Input is automatically suppressed when pointer is over UI
// if BlockWhenPointerOverUI is enabled
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mindcodeinteractive.gitbook.io/easy-build-system/reference/building-controller/building-input.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
