GameSalad

Freeze Button

I made a button that spawns an actor (called "wall") every time it is pressed.
The wall gets destroyed every 10 seconds. I wanted to make it so that 10 walls is the limit but I can spawn again if the walls get destroyed after the 10 seconds count.

How do I do this? Should I make the button unusable when wall count is 10 and make it usable if it is less than 10? If yes how do I do that?

Comments

  • SocksSocks London, UK.Posts: 12,453

    @darren.gregorio@gmail.com said:
    I made a button that spawns an actor (called "wall") every time it is pressed.
    The wall gets destroyed every 10 seconds. I wanted to make it so that 10 walls is the limit but I can spawn again if the walls get destroyed after the 10 seconds count.

    What does '10 walls is the limit' mean ?

    The spawner spawns 1 wall at a time, 10 times, and then no more ?
    Only 10 walls can be on the scene at once ?
    Only 10 walls can be destroyed ?

    . . . etc etc ?

  • I mean there cannot be more than 10 walls in a scene at once.
    The walls destroys itself in 10 seconds after spawn

  • SocksSocks London, UK.Posts: 12,453
    edited March 20

    When a wall is spawned change X to X+1

    When a wall is destroyed change X to X-1

    Only spawn if X <10

  • Thankyou so much, this works!

Sign In or Register to comment.