0 like 0 dislike
6 views
asked in C sharp (C#) by (5.6k points)
How I can to tracking certain key pressed event in Unity3D game engine? How to get certain key pressing in Unity? How to get certain key is pressed?

get keys unity

Your answer

Try to answer the question as detailed as possible.
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

0 like 0 dislike
answered by (5.6k points)
edited by

Use Input.GetKeyDown() method.
Unity code (C#):

void Update() {
	if (Input.GetKeyDown(KeyCode.R)) {
		gameObject.renderer.material.color = Color.red;
	}
}
This unity code show how to get certain key is pressed.

Links

Related questions

0 like 0 dislike
1 answer 35 views
0 like 0 dislike
1 answer 46 views
0 like 0 dislike
1 answer 42 views
0 like 0 dislike
1 answer 7 views
0 like 0 dislike
1 answer 9 views
0 like 0 dislike
1 answer 7 views
0 like 0 dislike
1 answer 20 views
0 like 0 dislike
1 answer 10 views
0 like 0 dislike
1 answer 22 views
0 like 0 dislike
1 answer 13 views
...