Using Random

SlightlyGrimSlightlyGrim Member Posts: 51
edited November -1 in Working with GS (Mac)
ok, I'm new to this but I can't seem to find anything on how to make random number between certain points? It would help me lots if someone can explain how us them.

cheers

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi SlightlyGrim, by between certain points you mean say, random x and/or y coordinate, then the following should help you:

    In your Rules put Change Attribute scene.YourActor.Position.X to random(24,500) THis example then will move your actor called YourActor to a random x position between and including 24 and 500, for example.

    If you don't know, you get the random by holding down the e, and in the list hiding under the second small disclosure triangle there is random. Choose that, and insert your figures for min and max. Hope that helps. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • SlightlyGrimSlightlyGrim Member Posts: 51
    Helped very much cheers, Some extra help would be grateful for what I'm trying to do. I have a health bar which has health randomly generated, only issue is I don't want my health bar to vary in size. I used the health bar tutorial from gamesalad how to. Can be found here:



    if anyone knows a better way to do this or away of how to fix the problem would be a great help

    cheers
Sign In or Register to comment.