W
White_heart_of_Blood
Guest
I need help making a wander state for my enemy. I have been having trouble with this. Here is my code
This is all in a script that is being called in my step event.
My problem is that he wont move at all.
It could also help if I know how to stop the wander state to go into a choose state
Code:
/// sc_enemy_wander_state
randomize();
var x_wand, y_wand;
x_wand = x;
y_wand = y;
if (distance_to_point(x_wand, y_wand) == 0) {
do {
x_wand = random(room_width);
y_wand = random(room_height);
} until (!place_meeting(x_wand, y_wand, ob_wall));
}
mp_potential_step(x_wand, y_wand, 5, false);
My problem is that he wont move at all.
It could also help if I know how to stop the wander state to go into a choose state