need help generating specific random positions

pranshudhungana21pranshudhungana21 Member, PRO Posts: 20
edited August 2016 in Help Wanted

So in my game i have two actors who are obstacles once they are together. They are 2 spikes and i have 3 different ways in which the spikes could be laid out, as this a endless runner, i had difficulty in trying to find a way to randomise the 3 different way the spike could be laid out. I tried using the rng but because it can only randomize 2 way in which it could be laid out . its hard. Could anybody help with this problem?

Comments

  • NNterprisesNNterprises Member, PRO Posts: 387

    Create an integer attribute called RANDOM

    TIMER:
    Every .1 seconds, change RANDOM to random(1,3)

    RULE:
    If RANDOM = 3, spawn spike1 on top or whatever
    ELSE - if RANDOM = 2, spawn spike2 in middle or whatever
    ELSEELSE- if RANDOM = 1, spawn spike3 on bottom or whatever

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    //

  • NNterprisesNNterprises Member, PRO Posts: 387

    @Socks is always topping me

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2016

    //

  • NNterprisesNNterprises Member, PRO Posts: 387

    lol your good @Socks . No need to go into hiding

  • pranshudhungana21pranshudhungana21 Member, PRO Posts: 20

    thanks so much

Sign In or Register to comment.