|
Java Code - Key Press
[Back]
Code:
//Key Press
//Before you can use the ("w, s, a, d or any arrows key")) you much go to Edit, Project Setting and then hit input
//and up the Axes size, this will let us add new one,
//we going to change the name of the new one [but right now it should has the same name has the last
//one on top of it] what we want to do next is change the [Positive Button] to any key you want.
//The GetKeyDown only move it one time for ever time you press that key
if (Input.GetKeyDown ("w")) //The w is what key is down
{
}
//The Input.GetButton this what tell if that key is hold down.
if (Input.GetButton ("w")) //What keys pressed is down
{
}
//Before you can use the ("w, s, a, d or any arrows key")) you much go to Edit, Project Setting and then hit input
//and up the Axes size, this will let us add new one,
//we going to change the name of the new one [but right now it should has the same name has the last
//one on top of it] what we want to do next is change the [Positive Button] to any key you want.
//The GetKeyDown only move it one time for ever time you press that key
if (Input.GetKeyDown ("w")) //The w is what key is down
{
}
//The Input.GetButton this what tell if that key is hold down.
if (Input.GetButton ("w")) //What keys pressed is down
{
}