xmouse ymouse glitch, or im i not writing this right?

i have this code to make the the actor walk facing the mouse based off only 4 directions.
it works with objects, but when i use it on xmouse ymouse it glitches and the player only sometimes walks the right direction
can anyone help me? thank you very much.
it's not really nesesary(wow i suck i spelling) but it's rather annoying
it works with objects, but when i use it on xmouse ymouse it glitches and the player only sometimes walks the right direction
can anyone help me? thank you very much.
it's not really nesesary(wow i suck i spelling) but it's rather annoying
- Code: Select all
angle = direction(x, y, xmouse, ymouse);
if(angle < 45 || angle > 315)ChangeAnimation("Event Actor", "walkEast", FORWARD);
if(angle > 45&&angle < 135)ChangeAnimation("Event Actor", "walkNorth", FORWARD);
if(angle > 135&&angle < 225)ChangeAnimation("Event Actor", "walkWest", FORWARD);
if(angle > 225&&angle < 315)ChangeAnimation("Event Actor", "walkSouth", FORWARD);