Solution for "Input.GetKey() function unity"

if(Input.GetKey(KeyCode.Space)) { //do somthing }

get key unity

using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Update() { if (Input.GetKeyDown("space")) { print("space key was pressed"); } } }

if get key down unity

Similar codes for "Input.GetKey() function unity"


Latest 'C#' questions

Added before "Input.GetKey() function unity"