I supose that blender don’t acuealy crash, but it hangs up on the logic tic when the while loop where runned for the first time,
The engine works in the way that it need every script/action to finich in order to advance to the next logic tic, when u set an infinity while loop the script never finich and therfor the engine never goes to the next logic tick and then “frezes”
I might be wrong, but I think this is why it chrashes 4 U
(sry 4 bad spelling, had no spellchek on this computer)
I think you might be misunderstanding how while loops work. While loops are like for loops, but they go on until the condition is satisfied. If distance is greater than 1 when the game starts, then it will continually execute cont.activate(anim_walk) in the current game frame, and so never continue to run the game. Why would you want to replace the if statement with a while statement? Why not just run the script every frame, if you want that?