Sticking Buttons!
Hi All,
I have left and right buttons in my game and every now and then my actor will move itself to the extreme left or right and stay there until I press the button again which releases it.
Does anyone know what might cause this?
Any help would be appreciated.
Cheers.
I have left and right buttons in my game and every now and then my actor will move itself to the extreme left or right and stay there until I press the button again which releases it.
Does anyone know what might cause this?
Any help would be appreciated.
Cheers.
Comments
Calvin
If you think of like a space invaders game where you have left and right buttons which control the space ship at the bottom of the screen,well that is kinda like my game.
The control buttons work perfectly fine making my character go left and right.But every now and then my character will shoot off to the side of the screen and stay there
until I press the left or right button again which seems to unstick it and then I can control it again.
Hope this makes sense.
can you explan this?
As a test, I would set up two objects in your scene. Each of these test objects should Display the Boolean Attribute you're using to send the actor left or right. Make sure they say TRUE and FALSE when they are supposed to. If not, take a look at your rules and make sure there's no overlap.
What rule are you using, when touch is pressed? released? something else?
The rules I'm using are when touch is pressed -true and when touch is released -false
Cheers
I had a similar issue when using a "when touch is released" rule with the rule not firing off all the time, but the "otherwise" statement fixed it…For me at least.
I have been struggling to release my app on android but the sticky keys is really annoying.
Have tried so many ways of making the button rules but still the sticky keys will appear sometime in the game.
And here's my first guess…It should work, keyword being "should" If it doesn't, maybe have both rules going. Have the "otherwise" statement, and also have the Rule "when touched is released" so that you have it covered from 2 different angles?
Your best bet is to get it on an Android device, and test it. Or is that what you mean you are having a problem with? Is it not working on Android sometimes, or are you just worried it's going to happen?
rule on button.
when touch is pressed
game.left = true
otherwise
game.left = false
play game and at some random point, it seems to be stuck in touch = pressed even if no buttons on the screen are pressed. you have to touch the button again for pressed = false.
so i thought, ok, add
when touch is released
game.left = false
no change, still same random problem.
then I added both parts to a timer.... EVERY 0. made no difference.
i have tested this on kindle fire and galaxy tab 10.1.