Need help!
-
Hey guys! I’m making a subway surfers like game I guess, how would I make random generated objects? If anyone can give me a tip on this it will be much appreciated! Thanks!
-
Hello! You can generate random outputs and associate those outputs with an event in the game.
For example, there could be a 10% chance every time that a coin can spawn.
To achieve the example ahead, you use a Random Number behavior. For this case, you can make it generate a number between
0 and 9
inclusively (10 unique numbers). You can use an If behavior and say that if the output of the random number behavior equals 1, then spawn a coin.The coin spawning would happen 1 out of 10 times because there are 10 possible outcomes with only 1 having a coin spawning.
Of course, you can go further than that and use a bunch of if behaviors and random numbers - go crazy! :)
-
If you have a bunch of different objects you wanna spawn but only want to spawn one of them at a time, I recommend using the Execute Sequence behavior.
This behavior only executes only one of the behavior nodes connected below. Just make sure you set the mode to
Random
. -
@RobinsonX Thanks! It doesn’t work that well, but it may be because i’m doing something wrong, i’ll keep trying.