while(sign(ang(h_direction - player.pan)) != 0)

make that a range instead of one value. The player angle will never precisely end at 0. Then, when you quit the while loop, correct the tiny deviation in the angle to the exact rotation it should be facing.


Click and join the 3dgs irc community!
Room: #3dgs