Quantcast
Channel: Answers for "Wait before being able to press button again"
Browsing latest articles
Browse All 4 View Live

Answer by KillMobil

Input.GetButtonDown ("Fire1") returns True or False and therefore you have to constantly check it with an Update function. There is a great example in Unity documentation that probably does what you...

View Article



Answer by BroVodo

bool canShoot = true; public float coolDown = 5.0f; void Update() { if( Input.GetButtonDown ("Fire1") && canShoot ) { Shoot(); canShoot = false; Invoke( "CooledDown", coolDown ); } } void...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images