
Stopping and starting when pressing the same button.
Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
-
-
It's because the game quickly checks when you're pressing the button. It will activate both conditions within the time you press the key.
I would use the key to toggle a flag. Then when the flag is either on or off, switch the movements.
Sent from my iPhone using Tapatalk
-
User clicks with right button
Soldier is stopped
Soldier -> movement start
Flag 0 is offUser clicks with right button
Soldier is not stopped
Soldier -> movement stop
Flag 0 is offThen add an action to each: "Turn flag 0 on".
Lastly, create an additional event:
Flag 0 is on: Turn Flag 0 off.
-
I tried this and maybe I didn't understand but it did not work. Can I have an example please?
-
User clicks with right button: toggle flag 0
Flag 0 is ON:
Soldier movement startFlag 0 is OFF:
Soldier movement stopSent from my iPhone using Tapatalk
-
Thank you it works now. But now the player can go out of bounds, how can I prevent this?
-
Test position of player. Click all the arrows that point outside the sides of the frame.
The condition now will read "when active leaves the play area" (or something similar to that)
Then stop the player.
Sent from my iPhone using Tapatalk
-
That is what I originally had it and now it is broken.
-
When player leaves the play area: set flag off?
Sent from my iPhone using Tapatalk
-
This way will work if you're not using the current status of the timer for anything.
User clicks with right button
Soldier is stopped
Timer is greater than 0.02
Soldier -> movement start
Set Timer -> 0User clicks with right button
Soldier is not stopped
Timer is greater than 0.02
Soldier -> movement stop
Set Timer -> 0 -
I think you could just try adding this to Sumo's solution:
Flag 0 is ON:
+(limit condition) only one action when event loops
Soldier movement startFlag 0 is OFF:
+(limit condition) only one action when event loops
Soldier movement stopI guess the soldier doesn't stop at frame borders because it gets constantly "started" while its status is ON
(but switching constantly while he collides could cause the bug as well, then you may want apply additional code for extra safety)
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!