How do I spawn an object a set amount of times

0 favourites
  • 4 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • So in my project I want the character to be able to shoot 10 times then you have to wait 10 seconds then you can fire again. When I tried to do it I made a global variable then when it reached zero it would disable the weapon, then after 10 seconds it would set the global variable 10 and reactivate the gun. It worked for the first time I could shoot 10 times then it would stop after 10 seconds it would start up again, but then it wouldn't stop after 10 seconds anymore. It would just keep shooting endlessly. Hope you can help

  • I would do this with a timer attached to the player.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I saw your file this night.

    Is it possible that you use something like "IF variable = 0, THEN wait 10 seconds, THEN add x amount to variable"?

    If yes, its possible that you go below 0, but the line above will only work if you exact at 0.

    Try to use "equal or less" instead of "equal".

  • Ok so it mostly works now but after I shoot my gun 10 times and it stops for 8 seconds then the bar won't go down untill like 5 seconds after it resets

    Here see for yourself:


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)