How do I stop controls?

0 favourites
  • 10 posts
From the Asset Store
Have you tried to create realistic and at the same time casual tank movements? You found the perfect solution!
  • I'm very new to Construct 2, and I'm running into a few problems. The biggest seems to be me trying to find a way to stop all other controls while an action is taking place. I have a rolling animation, but I want it so that you cannot change direction or jump or anything until it's over, as I can't seem to find anything that disables controls?

    Thanks for taking the time to read

  • I'm very new to Construct 2, and I'm running into a few problems. The biggest seems to be me trying to find a way to stop all other controls while an action is taking place. I have a rolling animation, but I want it so that you cannot change direction or jump or anything until it's over, as I can't seem to find anything that disables controls?

    Thanks for taking the time to read

    Simple mode... You can create a variable called "canMove" with value = 1... Then add to change direction controls (On press) AND (canMove=1) moves the character.

    Then (On Press Key) to your animation that blocks the movement, canMove=0.

    OBS: To add another condition for an event - RIGHT-CLICK it>add>add another condition>system>compare variable

    You can improve this... Just an idea friend. bye!

  • [quote:2pzxoow2]Simple mode... You can create a variable called "canMove" with value = 1... Then add to change direction controls (On press) AND (canMove=1) moves the character.

    Then (On Press Key) to your animation that blocks the movement, canMove=0.

    OBS: To add another condition for an event - RIGHT-CLICK it>add>add another condition>system>compare variable

    You can improve this... Just an idea friend. bye!

    Hey, thanks for responding! This is what I had in mind, unfortunately I can't seem to find the change direction controls for the character as seen here - [http://tinypic.com/view.php?pic=2qda7fq&s=8#.VX47UvlVhBc]

    The current controls are copied from Scirra's tutorial on making a platformer, so I don't really know how to alter them into usable keyboard controls to place the CanMove variable on them?

  • there is an action "set ignoring input", which might be of use here?

  • there is an action "set ignoring input", which might be of use here?

    Thank you . I tried implementing it but it doesn't seem to work. Basically what I need it for is I'm adding acceleration via custommovement when a certain attack animation happens, this makes them fly forward. But if I happen to press in the opposite direction mid attack, the character acceleration continues even after the animation, making my character slide off in one direction.

    Here's what I've got for the attack, with the implementation of set ignoring input seemingly doing nothing:

  • [quote:2y3p5d2n]Simple mode... You can create a variable called "canMove" with value = 1... Then add to change direction controls (On press) AND (canMove=1) moves the character.

    Then (On Press Key) to your animation that blocks the movement, canMove=0.

    OBS: To add another condition for an event - RIGHT-CLICK it>add>add another condition>system>compare variable

    You can improve this... Just an idea friend. bye!

    Hey, thanks for responding! This is what I had in mind, unfortunately I can't seem to find the change direction controls for the character as seen here - [http://tinypic.com/view.php?pic=2qda7fq&s=8#.VX47UvlVhBc]

    The current controls are copied from Scirra's tutorial on making a platformer, so I don't really know how to alter them into usable keyboard controls to place the CanMove variable on them?

    Here my friend http://i.imgur.com/YUhCXnZ.png?1 a solution for you... I've made right now and worked like a charm, maybe this can help you!

    and the .capx https://mega.co.nz/#!ORkkBQQa!RC8DAzNmhIX9wHx_IHqnYMeVzRPLepZa-WhQKmqzrcw

  • [quote:2myrcdin]

    Here my friend a solution for you... I've made right now and worked like a charm, maybe this can help you!

    and the .capx

    Hey, thanks for that, it has helped a bit. If you can open my project, there's a copy here- The whole reason I'm trying to do this is because if you use the A attack in game and move side to side with the arrow keys, the whole sprite continues to accelerate, even though it should come to a stand still when the animation ends... I've tried everything, setting speed to 0, acceleration to 0 at end of animation etc...

  • You can add all your control input events into a group and then disable/enable the group based on whatever conditions you want.

    So you can have a group called "Controls" which will have all your control events in it, then have something like 'Ball - animation rolling playing ----- System - Set group "Controls" deactivated'. Then do the opposite to reactivate. 'Ball - animation rolling stopped ----- System - Set group "Controls" activated'.

    I hope that works for you!

  • [quote:2d0rb6bo]

    Here my friend a solution for you... I've made right now and worked like a charm, maybe this can help you!

    and the .capx

    Hey, thanks for that, it has helped a bit. If you can open my project, there's a copy here- The whole reason I'm trying to do this is because if you use the A attack in game and move side to side with the arrow keys, the whole sprite continues to accelerate, even though it should come to a stand still when the animation ends... I've tried everything, setting speed to 0, acceleration to 0 at end of animation etc...

    Hey friend, you can't put URL's in here because you're new... Try to break the link like site(.)com

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [quote:c9uhxeii]

    Hey friend, you can't put URL's in here because you're new... Try to break the link like site(.)com

    mega(dot)co(dot)nz/#!PQ0DyIpT!FtEEl8VR0-dXtLPCxmC03xTXjWEiVBMJ0aUL8tWV_Wo

    Hopefully that works, thanks!

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