Need help with going from walk to idle animations

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I am new to Construct 3 and I am running into animation issues and need some help. So I am trying to get my animations going from walk to idle based on direction. Currently I use TileMovement and check to see if the correct keys are down. Then I simulate the pressing button. I also have a variable on my player object called "DIR" for the direction the player is facing on key down. Then finally I set the correct animation for the walk. The walking seems to be working fine however when the player stops it should move over to the idle animation. I check to see if the player is not moving or attacking then I check the "DIR" variable on which direction the player is facing. Based on "DIR" I then switch the animation to the correct Idle. However when I run the game the idles work in some directions but then those directions are used across all the animations. So for instance if I hit the down button the player walks correctly in that direction. When he stops he will idle correctly for the first time. Then if I hit the up button the player will walk correctly but the idle will still be the down animation. I know I am missing something but I am not sure what. Below is the images of my event list and an image of the animations I have for the player. Hopefully my blabbering makes sense to you all.

  • It's (probably) because you've used separate bools for the directions instead of one variable. So when you press Down then Up, they are both true because there's no logic to set the other one to false. You should use a single string variable for the direction and set it to Up, Down, Left or Right.

  • Thanks for the reply I will give this a shot

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Excellent this solution worked thank you very much

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