[Solved] Spawn an Enemy by Chance

So if I have 2 Types of enemies and want to spawn them by a chance how Do I do that?(So there is a Chance for Enemy1 to spawn and theres a chance for enemy 2 to spawn)

On beginning of the scene: set variable random to (Expression for random in range) with parameters 0 and 1. Then at the moment to spawn the enemy make condition random is = 0
then spawn enemy 1 and another if random is 1 then spawn enemy 2

1 Like

or, you can use the expression while create the enemy. but you should create a group for your enemies in this method. and you should name them according to certain rules. for example I name them “enemy1” and “enemy2”, and put them in a group named “enemies”. under these circumstances the create action looks like this:

1 Like

“make condition random is = 0 spawn enemy 1 and actions if random is 1 spawn enemy 2” could I please get a picture of that im not quite sure i understood what you mean.

Already got it thanks