Randomosity

svnsvn Member Posts: 445
edited November -1 in Working with GS (Mac)
How do I get actors to spawn at or move to random locations?

Comments

  • youngster9youngster9 Member Posts: 326
    When you use a spawn actor behavior use the function random in the expression editor on all the things in the spawn actor behavior you want random. Remember to set the min and max values in the random expression.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    in the spawn behavior for the x position have: random(0,480) for the y position have: random(0,320)

    and to move to random locations you can do change velocity and do random(0,360) for the direction

    that will make it move in one random direction

    or you can throw a timer in and have every .5 seconds (or whatever you want) change velocity direction random(0,360) that will have it continuously moving in random directions and locations all the time and change direction every .5 seconds

    then you can just put unmoveable walls around the scene and tell the spawned actor to collide with them to keep everything in the scene area if you don't want them to move off camera
Sign In or Register to comment.