Answers for "how to check keyboard press in unity"

C#
10

unity check if key pressed

if (Input.GetKeyDown(KeyCode.KEY))
Posted by: Guest on June-15-2020
1

c# unity detect any keyboard input

// Detect any keyboard input but not mouse input
private void Update()
{
	if (Input.anyKeyDown && !(Input.GetMouseButtonDown(0) 
    	|| !Input.GetMouseButtonDown(1) || !Input.GetMouseButtonDown(2)))
	{
    	Debug.Log("No mouse pressed!");
	}
}
Posted by: Guest on December-06-2021

Code answers related to "how to check keyboard press in unity"

C# Answers by Framework

Browse Popular Code Answers by Language