Animation help

0 favourites
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hey guys, so I have an enemy that will simulate controls based on the X of the Player character, so that it will run towards the player.

    Now I have it as a turret so when it's within a certain range of the player it will shoot and activate the shoot animation.. however it just stays on the shoot animation even when moving after the player again. It doesn't go back to the run animation when simulating left or right.

    Thanks in advance!

  • Here are my events.

  • use a variable with the name STATE and set the value of your sprite current state, for example when your sprite STATE its running -> set animation running , if your STATE its shooting -> set animation shooting.

    https://www.scirra.com/manual/73/instance-variables

  • use a variable with the name STATE and set the value of your sprite current state, for example when your sprite STATE its running -> set animation running , if your STATE its shooting -> set animation shooting.

    https://www.scirra.com/manual/73/instance-variables

    So would that take away the need for the Platform on moved - Animation = run ?

    So instead it would be Platform on moved - Set STATE to run ?

    Then

    if STATE = Run - Play animation Run ?

    Or instead would I not use the platform moved and set the STATE to run when I compare the X value of Hero? Like have it above with compare X Hero then simulate left/right ?

  • > use a variable with the name STATE and set the value of your sprite current state, for example when your sprite STATE its running -> set animation running , if your STATE its shooting -> set animation shooting.

    >

    > https://www.scirra.com/manual/73/instance-variables

    >

    So would that take away the need for the Platform on moved - Animation = run ?

    So instead it would be Platform on moved - Set STATE to run ?

    Then

    if STATE = Run - Play animation Run ?

    Or instead would I not use the platform moved and set the STATE to run when I compare the X value of Hero? Like have it above with compare X Hero then simulate left/right ?

    yes, use variables, each variable will contain the animation to run, Platform on moved - Set STATE to run

  • Ok, I did what you said and added a state as you can see from my events.. however he just stays in the 'Spit' animation once in range and again doesn't change back to run when moving in between spitting.

  • because you need use variables in platform is jumping and platform on stopped, you cant have animations outside the variables, STATES = run, jumping, idle....

  • Ok I just set the states for each platform 'instance' and it didn't make a difference, he still just keeps repeating the 'spit' animation

  • You can use On animation finished, set animation to idle.

    Or On key released (Shoot button), set animation state to idle

    Maybe check to see if you have the 'spit' animation set to loop, in animation properties.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use On animation finished, set animation to idle.

    Or On key released (Shoot button), set animation state to idle

    Maybe check to see if you have the 'spit' animation set to loop, in animation properties.

    None of that worked. Also spit animation is not set to loop

  • > You can use On animation finished, set animation to idle.

    >

    > Or On key released (Shoot button), set animation state to idle

    >

    > Maybe check to see if you have the 'spit' animation set to loop, in animation properties.

    >

    None of that worked. Also spit animation is not set to loop

    upload your capx, its more easy to help, you can make a new capx with the issue if you dont want to share your complete capx, you can try to use boolean variables too so if you are running you cant be idle etc..

  • You can see all of the events I have on the event screenshots I have uploaded.

  • You can see all of the events I have on the event screenshots I have uploaded.

    don't be lazy, i solved some of my problems just making a new .capx

    http://www.filedropper.com/states

    this capx its working ok.

  • > You can see all of the events I have on the event screenshots I have uploaded.

    >

    don't be lazy, i solved some of my problems just making a new .capx

    http://www.filedropper.com/states

    this capx its working ok.

    I already PMd you my capx. Also that capx you uploaded is from a newer version. I have 212.2

  • >

    > > You can see all of the events I have on the event screenshots I have uploaded.

    > >

    >

    > don't be lazy, i solved some of my problems just making a new .capx

    >

    > http://www.filedropper.com/states

    >

    > this capx its working ok.

    >

    I already PMd you my capx. Also that capx you uploaded is from a newer version. I have 212.2

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