Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I am trying to get my weapons to fire once every 5 secs while pressing the spacebar. I used the Wait event but as long as i keep pressing spacebar, it still keeps firing. How do i set a reload time so that even after firing, pressing the spacebar will have no effect till the 5 sec reload is up.
Thanks for any advice !
Every X seconds
Run the event regularly at a given time interval in seconds. This can also be used beneath other conditions to only run the event at a given time interval while the other conditions are true, e.g. "Player is holding spacebar AND every 0.5 seconds: fire laser".
Develop games in your browser. Powerful, performant & highly capable.
The best and easiest way to do this.
Put a var onto your player called. NextShot and make in a number.
When you fire the weapon
If(NextShot < time)
Fire the weapon stuff
NextShot = time + 5 seconds
How to you make the var for the time? Like i set reload to 5. How to set a timer to count down to 0 so i can fire the next shot?