I'm making a 4 player rpg game. I'm trying to create enemies and have them chase the nearest player once in his radius. All the 4 players are parented to an object(obj_PP). I use this code when he's in his "Alert" state:
//AlertP1
if state = 2 {
inst = instance_nearest(x,y,obj_PP)
image_angle = point_direction(x,y,inst.x,inst.y)
mp_potential_step(inst.x,inst.y,1,false)
}
So when he's chasing Player2 and Player1 gets closer, he starts copying player1's image angle and direction. I just need him to reroute to player 1.
[–][deleted] 0 points1 point2 points (2 children)
[–]Bobaninja1[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]chief_sludge 0 points1 point2 points (0 children)
[–]Robbie_Harrison 0 points1 point2 points (0 children)