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 9inclusively (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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login