Answers for "check for a key press unity"

C#
12

unity check if key pressed

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

idenitfy if you press a key in unity

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKeyDown("space"))
        {
            print("space key was pressed");
        }
    }
}
Posted by: Guest on January-25-2020

C# Answers by Framework

Browse Popular Code Answers by Language