Answers for "press a key and click unity"

C#
4

unity when key pressed

void Update()
    {
        if (Input.GetKeyDown("space"))
        {
            print("space key was pressed");
        }
    }
Posted by: Guest on February-14-2021
1

press key run code unity c#

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

C# Answers by Framework

Browse Popular Code Answers by Language