Moving an object by a random number

  • Hi, I know this is possible but am unsure how to excute this action.
    I wish to move a non player object left by a random number and continue doing so until it colides with a specific object. It will probably need pause inbetween the random number generated as the image will travel too fast.
    Thanks in advance.

  • Use the Random Number behavior to generate random numbers.
    Use the Move By behavior to move an object from its current position.

  • @RobinsonX Thanks for a super fast reply. Where is the move by behaviour located, cant find it under object menu. Cheers

  • @Toastedghost Found it in transform. So do I use 0 - 50 in random. Then move by x -50. Though my object always moves the same distance an only once. I must be missing something.

  • @Toastedghost You're welcome! :)

    When selecting behaviors, there are green circles that pop up. These are behavior outputs.

    It can be a number from a math operation, text from a label, or anything. The random number behavior outputs a number, and to use it, you drag its green output icon to whatever input field you wish to populate it with.

  • Also, hyperPad has a Discord server if you want really quick replies from other people. We don't get notified on here outside the app, so Discord is a great way to communicate with others. :)

    You can chat with us there!

Log in to reply