Answers for "onkeypressed unity"

C#
20

unity key detection

if (Input.GetKeyDown(KeyCode.Space))
        {
            print("space key was pressed");
        }
Posted by: Guest on January-17-2020
4

if get key down 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
0

press key run code unity c#

if(Input.GetKey(KeyCode.space))
	{
  		print("Space key was pressed")
	}
Posted by: Guest on May-26-2020
0

onkeypressed unity

public void Update()
 {
      if (Input.GetKeyUp(KeyCode.X))
     {
        //do stuff
     }
 }
Posted by: Guest on February-04-2021

C# Answers by Framework

Browse Popular Code Answers by Language