Spawning Item with 4 or 5 Second Delay.

Hi,

How to spawn 5 item in one time with 2 seconds delay?...

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    Use a timer: After 2 seconds spawn the actors.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2013
    Are you wanting a 2 second delay between spawns? Just copy the timer 4 times (the first spawn should not use a timer) and increase the duration by 2 seconds each time.

    Spawn actor

    Timer after 2 seconds
    Spawn actor

    Timer after 4 seconds
    Spawn actor

    Timer after 6 seconds
    Spawn actor

    Timer after 8 seconds
    Spawn actor

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    @tatiang If you wanted an endless loop couldn't you make an actor so that every two seconds it adds 2 to an integer attribute and then another actor that says every (attribute) seconds spawn the actor?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2013
    @Utveckla_Games You sure could. With any more than 5 actors, I would definitely use a loop.

    And oops... a simpler solution for the above behaviors is two timers:

    Spawn actor
    For [8.1] seconds
    .....Every [2] seconds
    ..........Spawn actor

    I think I remember that a For timer set to exactly the duration (2*4=8) doesn't spawn the final actor.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SolarPepperStudiosSolarPepperStudios Member Posts: 754
    @tatiang ok cool! I should try to make that in a project and dump it onto the spare code discussion. :)
Sign In or Register to comment.