Differentiate between 1 touch and 2?
JScott
Member Posts: 143
Hi all, wondering if anyone has figured out a solution for this:
I have an actor that I want to move ONLY when touch count =1. However, I have another actor that responds to touch count =2.
About 50% of the time, the first actor moves on the 2 finger touch as well. I have a "when touch count =1" rule for this actor, but doesn't prevent it from responding to 2 finger touches.
I'm assuming this is because on most 2 finger touches one finger either touches, or leaves, the screen a fraction of a second before the other.
Any ideas? I've tried timers and a boolean attribute that turns on/off with 2 touch.
Thanks,
Jason
Comments
The touch count is not related to actors at all. The touch count changes even on an empty scene. The touch count tells how many fingers are present on the screen area period. You need to delay the execution of the touch 1 rule by like .3 seconds put the timer inside the rule and put the associated behaviors for it inside the timer, don't check run to completion.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Thanks @Lost_Oasis_Games . I've tried Timers with it, but will keep experimenting.
Age of Dominion RTS for iOS
Age of Dominion RTS for Android
You might just need to devise a different method of control.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Debug it by displaying the touch count attribute on screen
@zweg25 thanks, I've figured out the problem, just not how to fix it! At the beginning and end of most "2 touches" occurs a "1 touch". I can fix the initial unintentional 1 touch with a timer, but it's actually the 1 touch that occurs when your release a 2 finger touch that's more difficult (so far).
@Lost_Oasis_Games yes I'm asking a lot of the touch screen. I'm trying to implement the 2 touch to drag around the map, but there are all kinds of actions dependent on touch in the game. It's a real time strategy game, so the player controls each unit's movements, attacks etc. with touch. I'm using drag around the mini-map to navigate around the scene currently, which works well enough, but touch and drag to navigate would be nice.
I'll keep playing with it, thanks for the input.
Age of Dominion RTS for iOS
Age of Dominion RTS for Android