back and forth variable
jeffcollins
Member Posts: 13
Hi
I am trying to make an actor move in a random way, similar to the pace back and forward that has been mentioned on this forum before but I want the actor to randomly go left or right either a bit or all the way. Can anyone help me with any advice for this particular variable?
many thanks
I am trying to make an actor move in a random way, similar to the pace back and forward that has been mentioned on this forum before but I want the actor to randomly go left or right either a bit or all the way. Can anyone help me with any advice for this particular variable?
many thanks
Comments
Create an actor attribute that is of integer type. Call it LeftRight
Create a Rule to check if that attribute is equal to 0, then do your movement to the left.
Create a Rule to check if that attribute is equal to 1, then do your movement to the right.
Add a Timer behavior to the actor that every # seconds Change Attribute of the LeftRight integer attribute to the expression random(0,1)
It sounds like an ideal solution, Ive had a few problems implementing them though :-) but it gives me a head start,
cheers