I am making a 2d sprite in a 3d world and have been looking for/thinking of a way to get my 2d sprite (which has a set of images for each of 4 directions) to change which set of images it is using dependent on its current direction that it is either facing/moving (based on the y axis). This is for a click to move by the way, kind of like Ragnarok online.
my thoughts were to find the direction the object is facing and get it to change the animation with if statements.
i.e.
if (playerMove == true){
if (Lookat.y == >0 && <90) {
playFront() ;
}
if (Lookat.y == >179 && <270) {
playLeft() ;
}
if (Lookat.y == >179 && <270) {
playBack() ;
}
if (Lookat.y == >269 && <1) {
playright() ;
}
}
at the current point in time i’m not even sure if i’m using the right approach for this sort of problem.