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
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 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]
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]
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
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