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

    Need help!

    Scheduled Pinned Locked Moved Help and Support
    4 Posts 2 Posters 849 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          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 Offline
            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

            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
            • First post
              Last post