Give me a choice

I setup this quick blend I want the cube to go sometimes left and sometimes right. it works fine for one direction but when using 2 directions and a random actuator it just goes straight through the barrier How can i make it work randomly?

digiman

Attachments

choice.blend (130 KB)

i will use the python script:


import GameLogic, random
scene = GameLogic.getCurrentScene() 
cont = GameLogic.getCurrentController() 
own = cont.owner

choice = own.sensors["choice"]
seed = random.randint(1,2)
direction = cont.actuators["direction" + str(seed)]
cont.activate(direction)

and connect it like this:


choice -- python script -- direction1
                        -- direction2

I am confused by your directions i tried a few times to hooking it up but no luck hook it up on the new blend i posted(it has a armature), or if you know how to do the same thing in logic bricks let me know Thankyou

digiman

Attachments

choice.blend (135 KB)