Quantcast
Channel: Answers for "Detecting if 2 Buttons are pressed at the same time"
Browsing all 6 articles
Browse latest View live

Answer by Baste

A big question here is "why?". You usually want to allow the player to press several buttons at once. Also, GetButtonDown only registers on the frame the button is pressed - which means that two of...

View Article


Answer by Jarnak

Well, you could put this in your Update(). There is surely a better way, but it's the first that came into my mind. int count = 0; bool tooManyKey = false; foreach (KeyCode kc in...

View Article


Answer by LaneFox

Assuming the keys are known, I would use a static bool to gate the input logic. public class Keys : MonoBehaviour { public static bool SomeKeyIsDown; void Update() { if (!SomeKeyIsDown &&...

View Article

Answer by Baste

A big question here is "why?". You usually want to allow the player to press several buttons at once. Also, GetButtonDown only registers on the frame the button is pressed - which means that two of...

View Article

Answer by Jarnak

Well, you could put this in your Update(). There is surely a better way, but it's the first that came into my mind. int count = 0; bool tooManyKey = false; foreach (KeyCode kc in...

View Article


Answer by LaneFox

Assuming the keys are known, I would use a static bool to gate the input logic. public class Keys : MonoBehaviour { public static bool SomeKeyIsDown; void Update() { if (!SomeKeyIsDown &&...

View Article
Browsing all 6 articles
Browse latest View live


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