Spawning random actors in game

Hi everyone! Does anybody know, how to spawn random actors from/in one point in GameSalad? Please help!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Are you trying to spawn a single actor in random positions? Or are you trying to spawn multiple actors but choose a random one?

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

  • MadCursorMadCursor Member Posts: 15
    Are you trying to spawn a single actor in random positions? Or are you trying to spawn multiple actors but choose a random one?
    Hi! I want random actors to spawn in one position :)

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Let's say you have five different actors and you want a random one to spawn every 3 seconds.

    If you don't mind them repeating, just use a timer set to every 3 seconds and in the timer place a change attribute behavior and select an integer attribute. In the expression editor for that behavior, add random(1,5). Below that, add a rule for each possible value of the attribute:

    When game.choice = 1
    Spawn actor [actor name]

    When game.choice=2
    Spawn actor [another actor name]

    Etc.

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

  • MadCursorMadCursor Member Posts: 15
    Let's say you have five different actors and you want a random one to spawn every 3 seconds.

    If you don't mind them repeating, just use a timer set to every 3 seconds and in the timer place a change attribute behavior and select an integer attribute. In the expression editor for that behavior, add random(1,5). Below that, add a rule for each possible value of the attribute:

    When game.choice = 1
    Spawn actor [actor name]

    When game.choice=2
    Spawn actor [another actor name]

    Etc.
    Oh thanks very much! :)
Sign In or Register to comment.