Quantcast
Channel: Questions in topic: "keyboard"
Viewing all articles
Browse latest Browse all 605

KeyCode Input doesnt work.

$
0
0
Hello, I wrote the code for my 2D project that should open the door and disable the black screen in the next room once button F is pressed. { Button.enabled = false; BlackScreen.enabled = true; } private void OnTriggerEnter2D(Collider2D collider2D) { if (collider2D.gameObject.tag == "MAIN_Hero") { Button.enabled = true; if (Input.GetKeyDown(KeyCode.F)) { BlackScreen.enabled = false; } } } The code doesn't show any mistakes, however the Key F isn't working. I checked if it was a problem with UI but everything was working perfectly. Am I missing something? `

Viewing all articles
Browse latest Browse all 605

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>