How can I do this type of roll movement

0 favourites
  • 6 posts
From the Asset Store
Self Typing Text
$2 USD
80% off
Change delay, create new lines, "backspace" the text
  • Hey guys!

    I ran into a big stopper here.

    Im trying to make my character roll while running. The simple method is change speed and animation while moving.

    But in my case, I would like to do as follows:

    I press a key

    Character does the rolling

    If I press key to roll again, input is ignored until rolling is finished

    In a nutshell, I would like to do something similar to Dark Souls rolling.

    Thanks in advance!

  • Hey Fraktal,

    What I would do is give the player character a 'State' (instance text variable). When you roll you set the state to 'Rolling'.

    Now for your general controls you can invert the condition: State=Rolling. This means that none of those controls will work until the state is changed to something else.

    This way you can add special controls that will only work in that state, like what you need - the ability to roll again.

  • Hey Thanks GenkiGenka,

    I tried with States. Actually my whole system is based on states, but when I tried using a isRolling state, the animation would play only the first frame.

    What I have is

    Press directional key

    isRunStart which plays a run start animation

    On runstart animation completed, isRunning = TRUE

    On Dir. Key released, isRunning = FALSE Then isRunStop = True

    I cant find a way to make it work in between those states,

    My rolling so far works, but when I leave the key pressed, other animations wont play

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sorry for the late reply, if your animation is stuck on the first frame it will be because your calling it to play that animation (from the first frame) continuously. There is also an option to play it from the current frame.

    If you put up a minimal cap.x I will fix it for you.

  • Hey GenkiGenga thanks! I think I fixed it but not completely sure. I can easily spam the roll action and the Wait didnt work as expected so I assume I'm still not doing it the right way. I'm sending you a stripped down capx file and I added a bookmark to where the whole code its located. Thanks for your time!

  • Hey GenkiGenga thanks! I think I fixed it but not completely sure. I can easily spam the roll action and the Wait didnt work as expected so I assume I'm still not doing it the right way. I'm sending you a stripped down capx file and I added a bookmark to where the whole code its located. Thanks for your time!

    **I forgot to mention in my private message. I switched most of the controls to a controller instead of keyboard so the character moves with the left trigger.

    A button to jump, B button to roll and grab ledges.

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