RANDOM : Please help once and for all! PLEASE PLEASE PLEASE
TechnoDave
Member Posts: 103
Ok I have being trying to use the random behavior for ever now and it just does not work! I have searched and searched on this forum for a simple work around and all I get are complicated explanations that don't seem to work.
CAN SOMEONE PLEASE JUST GIVE ME A SIMPLE SOLUTIONS TO THE FOLLOWING!!!
I want a player to press a button, and when that button is pressed a random image will be spawned every time. That's it! Spawn a random image on touch.... Why can't I do this!!! lol
CAN SOMEONE PLEASE JUST GIVE ME A SIMPLE SOLUTIONS TO THE FOLLOWING!!!
I want a player to press a button, and when that button is pressed a random image will be spawned every time. That's it! Spawn a random image on touch.... Why can't I do this!!! lol
Comments
ON YOUR BUTTON ACTOR :
when actor receive touch is pressed :
Change Attribute game.randomimage to Random(1,10)
ON YOUR IMAGE ACTOR :
When Attribute game.randomimage=1
Change image to : Image1.png
When Attribute game.randomimage=2
Change image to : Image2.png
......
When Attribute game.randomimage=10
Change image to : Image10.png
PS : "randomimage" its an integer attribute.
Depending on the number of images you have, you might be able to employ the time attribute to create the limits of the random number, since the time will always be changing when the user presses the button.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left