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. :)
https://discord.gg/RpXHJXq
You can chat with us there!
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