Why does my animation stay on the same frame?

0 favourites
  • 12 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • I (believe I) have set up my animation events correctly yet when the animations switch they don't play. Any way that I could fix this?

  • When you check "Key is down" this event will fire every tick. So you are telling your sprite to play the animation from the current frame over and over, it never gets to the next frame. Try using "on key pressed" or add a "System > Trigger once". In that case you want to have your animation set to loop.

    Also since you use the same animation for all 4 directions you can create an "OR" block (right click on the event) and put all 4 direction keys inside, so you only need 1 event (unless you just do this for testing and want to replace the animations later down the road).

    Also also if you do intend to replace the animations later on so you have individual animations for up, down, left and right, keep in mind that when a player presses up & right, it will sort of attempt to play both animations so you have to make sure it does not do that.

  • Tried everything that you said: no difference. Still is stuck on the first frame. Anything else I can do?

  • Hmm, hard to tell without seeing everything. Maybe it´s the trigger once inside the or block (OR trigger once. In that case you don´t even need it actually), maybe the animation is set wrong, maybe try to play the animation from the beginning instead of current frame... etc etc. If you don´t mind you can share the project file.

  • Can't send the project file and changing the animation to beginning doesn't fix. Tried animation on separate project and works fine.

  • exedys Just to be sure, did you checked the "loop" property of the animation?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • exedys Just to be sure, did you checked the "loop" property of the animation?

    your problem is that you trigger the animation on a loop when you keep pressed the button, therefore the animation when you keep button down is always going to play from 1st frame, rendering the visual aspect to the 1st frame as it wont move. you need to trigger the animation with a condition trigger one time & button is down.> play animation

    in the last picture u showed remove the OR trigger once... that is already applied to the On button pressed condition which triggers only 1 time.

    from the 1st picture put the Animation run 1st then the 8 direction simulation lasts, and swap the condition for animation play to 8 direction is simulating control left up down right.

    Edited(31/3/2018/ 6:15 pm Romania time):

    For left and right movement you can code the frame animation to change +1 frame every 0.2 seconds or 0.1 second as the button is kept down, and when frame = ur max frames in the animation just reset the animation to 1st frame again.

    while the system of animation is simple by itself its a bit confusing when ur trying to play animations based on how long users keep the buttons down or not.

    You also do not need to have 2 sets of when buttons is pressed....

    il make u a C3 example using some color blox ul be able to implement it in ur game it will take a bit .... probably few hrs from this edit time

  • Well seen , it seems to be that. You can also add an "is not playing Run animation" sub-event.

  • Tried all the methods on the .c3p you sent: no dice. Nothing made the animation play, all it did was glitch out my movement.

  • exedys

    The simplest to help would be that you share a .c3p - debugging an image is not the most efficient and practical for everyone.

    You aren't forced to share your entire project, just involved events and your sprite (or a similar one+animations) should be enough.

  • exedys

    Just created a simple .c3p and it works as expected. I hope it can help! <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    https://www.dropbox.com/s/lx7vnsj05ki16 ... n.zip?dl=0

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