I cannot get sprite to flip based on pathfinding direction

0 favourites
  • 3 posts
From the Asset Store
Goodbye to sprite fonts, when you have something new on the anvil for your upcoming Games !
  • I will start by saying that I am not much of a programmer. Though my attempts of getting my sprite to flip left or right based on their direction has failed miserably. The animation will change maybe once ot twice or from time to time but every combination, every this, every that I have tried to do has failed. If any kind soul can figure out how to fix my problem and write it out for me step by step It would make my day, my patience cannot take much more of this torture

    Notes:

    - The sprites in question are cows and they move randomly in a pasture

    - The face either left or right (animation)

    - they obviously hate me

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There are a few ways this can be done. You could check the angle of movement which seems like the most intuitive, but there is an easier way. Check the x value of the pathfinding next node. If it's less then the current x, face left. If not, face right.

  • There are a few ways this can be done. You could check the angle of movement which seems like the most intuitive, but there is an easier way. Check the x value of the pathfinding next node. If it's less then the current x, face left. If not, face right.

    How do I find the x value of the next node? I cant seem to find that as an option, I found Object.Pathfinding.NodeXAt(0) but once you get past which ever node it is set to it doesnt work if the cows x value is past the x the first node and it breaks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)