Answers for "unity inputfield keyboard return key"

C#
3

how to get key input in unity

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKey("up"))
        {
            print("up arrow key is held down");
        }

        if (Input.GetKey("down"))
        {
            print("down arrow key is held down");
        }
    }
}
Posted by: Guest on February-15-2021
1

unity keyboard input

using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            print("space key was pressed");
        }
    }
}
Posted by: Guest on April-14-2021

Code answers related to "unity inputfield keyboard return key"

C# Answers by Framework

Browse Popular Code Answers by Language