Random directional movements
marty_colwell
Member Posts: 4
I was wondering if anyone can help? I want to show my actors from a top view and have them randomly walk around, and when they bump into a wall or another actor to turn and walk randomly in another direction. I am having problems with bump and turn part.
Comments
Create a boolean attribute for the actor. 'MoveForward' and set it to be true.
Rule: if collides with wall
- Change Attribute 'MoveForward' to false.
- rotate to angle: angle=random(0,359) Run to Completion, Stops on destination
- Timer: after 1 second, Change Attribute 'MoveForward' to true.
Rule: if Attribute Changes: 'MoveForward' is true
- Move: Direction=0, relative to actor.
Although this will work better with round collisions since the corners of the box will reactivate the rule when rotating.
Moved this post to the Game Design Support area.
This forum is one of the best, straight to the solution, thanks CodeMonkey, works like it should now.