Random Spawning but with a count?

Hello, I would like to know how to achieve a random spawn but with a count every time.

I want to spawn an object all over the screen multiple times it doesn't matter where it spawns but I want there to be a count.. so lets say its first spawn happens but only 30 objects spawn, the second time it spawns I would like it to spawn 17, third time it spawns I want it to spawn 67 & ect.. completely random

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    In the actor you are spawning have it update a game level attribute when it is spawned, like:

    Make an Integer Game Attribute named: actorCount

    In the actor you are spawning put a Change Attribute Behavior:

    Change Attribute actorCount to actorCount + 1

    That way when one is spawned on screen it will keep a count and you can use it as you see fit.

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @jamie_c‌ thanks you :) now how can I set a limit to the amount of spawns?

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    I made a second actor & put the display text in it so I can see how many it spawns

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Set up a rule that says something like:

    if actorCount is < 30
    
    spawn your actor here...
    

    This would limit the number of actors spawned to 30.

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @jamie_c‌ woked perfect

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    worked *

  • http_gamesaladhttp_gamesalad Member Posts: 1,340

    @jamie_c‌ hey sorry to bother you again but lets say I wanted to spawn a bunch of random actors at the same time example 10 at one time in a straight line how can I do this? :)

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    In the spawn behavior there is the spawn offset for X and Y location. You can use an Attribute there and increment it to spawn in a line.

    Do these actors that are spawned need to interact with other actors or are they something interface related, like 10 hearts in a row to display player health? If that is the case you could just use a Replicate Behavior.

Sign In or Register to comment.