user5113094
user5113094

Reputation:

Stop detecting Input in Unity?

How can I stop detecting input from the user in Unity? I want to achieve the following: "do not detect Input.GetMouseButtonDown" In C#?

Upvotes: 1

Views: 1523

Answers (1)

Flying_Banana
Flying_Banana

Reputation: 2910

You can't just "turn off" input from the Input class Unity provides. Instead, at where you handle input, add an if statement.

Eg:

void Update() {
    if (gameState != GameState.PAUSED) {
        if (Input.getMouseButtonDown(0)) {
            Debug.Log("Handle click!");
        }
    }
}

Upvotes: 3

Related Questions