My "if else" condition doesn't works, I can still press all of them same time and the message's showing up too
You won’t be pressing all of them within the same frame though. The
Input.GetKeyDown method only returns true during the frame that it is pressed down.
Also, it is better to copy/paste your code into your posts and apply the code formatting characters, rather than add screenshots. They are often quite different to read, especially on mobile devices without a lot of zooming/scrolling. It also prevents those that offer to help you from copy/pasting a part of your code back to you with suggestions/corrections.
Hey Rob, in the lesson, about between 5:10 - 5:15 Rick says that after adding the “if else” conditions, when we press the keys same time, output is only one, I rewatched it with subtitles on. Mine prints both when I pressing two keys same time.
I’m sorry about the screenshot instead of copy/paste. I didn’t think about someone copy/pasting it(And I’m very used to expressing myself with screenshots, coding society is new to me ). As im not at my working pc now, Ill copy the code later if you wish.
The code is working perfectly for me. Could you post a video or something similar?
I’ve noticed the same thing. I added in the ‘else’ keywords, and still every time I hit two keys at the same time, they would both show up in the output. I kept at it for a while, though, and I finally did manage to get just one key to show up. Conclusion: It only SEEMS that you hit both keys at the same time, but in reality there’s a tiny difference of at least one frame between them. I’m not going to worry about it for now.