How do I set animation/change animation of sprite within events?

0 favourites
  • 9 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hello I am new to construct 3 and i am learning step by step.

    I have got into a problem today, i have 3 animations left, right, idle. My sprite

    is idle when its not moving, walks right when its moving right. However I cant get the animation to show

    my sprite going left and character does not turn around.

    The image of my events below, i know i have the condition 8 direction moving for both right and left but i didn't see any other condition such as "is moving left" set animation to left for example.

    Any help appreciated thank you.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should use the keyboard for this:

    When key arrow right is pressing -> play "RightAnimation"

    When key arrow left is pressing -> play "LeftAnimation"

    When any key released -> play "Idle"

  • Also, are you sure you need separate left and right animations? Maybe you can simply mirror the character sprite (flip horizontally).

  • Thank you guys for your replies.

    MAVERICK - Thank you, your keyboard suggestion helped me out a lot and made me understand more things.

    However one issue is that once left key is released my sprite goes straight back to looking right. How do i fix this so when i press left arrow key and release it the sprite stays looking left. I tried using else etc but do not know how to do this.

    - Thanks for the suggestion, however I do not know how to do this, could u give me an example like maverick has? When i tried it the sprite just turned around upside down and stayed like that.

  • You have 1 animation Idle only so if you release any key, it will play that animation.

    To solve it:

    If left key released, play idle and set mirror is true.

    When pressing Right key set mirror is false.

  • You have 1 animation Idle only so if you release any key, it will play that animation.

    To solve it:

    If left key released, play idle and set mirror is true.

    When pressing Right key set mirror is false.

  • You have 1 animation Idle only so if you release any key, it will play that animation.

    To solve it:

    If left key released, play idle and set mirror is true.

    When pressing Right key set mirror is false.

  • When key arrow right is pressing -> Player set not mirrored

    When key arrow Left is pressing -> Player set mirrored

    And then you'll need just one walking animation.

  • Thank you guys helped a lot.

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