BGE : Stop Animation at an arbitrary point and return to frame 1 I am working on my Boss character for a project in the Blender Game Engine. He has an attack animation that plays when he gets within range of the player (detected via a near sensor.) However, I would like the attack animation on the boss to stop playing and return to the first frame if the player exits the near sensor's range. Is this possible to do with logic bricks, and if so, how?

(Sorry if I´m doing this wrong)

 I did this because I could not get the Near Sensor to work. (I replaced it with a Message, (called the "stop" where "Not Near" was and "Start" where the "Near" was)
And so I add  2 new Property one with -1 frame if Start was False. and one with if frame# was less 0 then Assing 1. so it was always 1 if it gos back to zero.
and added to a sensor where the boss is. So if I leave the area then it send the stop message and then Boss goes back to the starting position.

The only problem now is that if I leave the area and if the Boss is on Frame 30
And I go back then he starts on frame 1. But I will solve it.
Yes. You can do this with logic bricks. You can actually do quite a bit with logic bricks. (I've made entire games only using logic just to prove it is possible to do so)
You'll need to start with two properties, a Boolean to control when the animation is playing, and an Integer property to control what frame the animation will display.
You'll need an always sensor (with true level triggering enabled) connected to an action actuator set to property - this will make the selected action display the frame of that action that correlates to the property that is set in the actuator.
You'll need your boss object's near sensors detecting the player, and assigning the Boolean property true or false.
Then, when the Boolean property is true, it will rapidly add 1 to the integer property controlling the animation's display frame, making the animation play. The moment the Boolean property turns false, it will assign the animation's frame to 1, resetting your boss object's attack.
You'll also want a property sensor waiting till the animation is done playing, to allow looping. to do this, set the value in that property sensor to however many frames is in your animation. When testing, I used a 40 frame animation, so I put 40 in that field. This property sensor can connect to the same actuator as before that assigned the frame number to 1, as it has the same function (resetting the animation.)
Or, if you do better with pictures: