Enemy pointing in the direction of player it is chasing
JCFord
Member Posts: 785
I have an enemy chasing my player onscreen and working great but I want the enemy to point in the direction it is moving in.
I have tried different methods but just can't seem to get this right, any advice?
I have tried different methods but just can't seem to get this right, any advice?
Comments
I have that setup already and it works if the enemy is moving left, right, up or down but like you said when the enemy is moving diagonal that seems to be where its going wrong.
So I either need a way of knowing if the enemy is moving diagonal and have a separate image for that, or having a way of rotating the enemy so its always facing the player it is chasing. I have tried the rotate to Target X and Target Y position I have located on the player its chasing but that doesn't seem to work either?
I used a Rotate to position: Target X and Target Y and just wrapped it in a timer to update every 0.1 second and it works a treat!
Thanks
http://gamesalad.com/game/play/33467