logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Need help!

    Scheduled Pinned Locked Moved
    Help and Support
    2
    4
    181
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • aPaperWeightA
      aPaperWeight
      last edited by

      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!

      1 Reply Last reply Reply Quote 1
      • RobinsonXR
        RobinsonX
        last edited by

        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! :)

        aPaperWeightA 1 Reply Last reply Reply Quote 0
        • RobinsonXR
          RobinsonX
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • aPaperWeightA
            aPaperWeight @RobinsonX
            last edited by

            @RobinsonX Thanks! It doesn’t work that well, but it may be because i’m doing something wrong, i’ll keep trying.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post