Confused touch...

LordTarantorLordTarantor Member, PRO Posts: 890
edited November -1 in Working with GS (Mac)
Hello everybody:
I am using the joystick, you know the one that interact with the touch actor that you put in the scene. I have other buttons in the scene. The problem is that sometime while I am pressing one of this other buttons (not the joystick) if I press the joystick to move the actor, the actor moves to the direction of the other button I am pressing. And obviously I want the actor to move only when I touch the Joystick and only to the direction pointed by the joystick. Does somebody knows what I am doing wrong, help, please.

Comments

  • AfterBurnettAfterBurnett Member Posts: 3,474
    I have the same issue. been over and over the code and it should not be happening. I have told the ship to react when the "tap area" is touched, yet sometimes it jumps to the fire button when that is pressed... makes no sense as it's a completely different button with completely different rules/behaviours.
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Well lets find out if someone else have solve this problem.
  • MotherHooseMotherHoose Member Posts: 2,456
    Ugh! I had similar problem this morning! with everything on the screen wanting to move with one touch if they were near each other!

    I ended up making a game.pickIndex (index type)
    then rule if actor (joystick) touched: set that variable to 1 or other # in your index
    a rule if touch released set to 0

    in character actor:
    rule if game.pickIndex is 1...do whatever

    don't know if that applies to your problem, though...
  • LordTarantorLordTarantor Member, PRO Posts: 890
    thanks mother...ok...I tried that and I don't know if I am doing something wrong but its doing the same and I think its all about the touch.
    I noticed that when I am pressing a button (not the joystick) the touch its right there and if I leave the finger on that button no mater where I move the joystick the joystick its going to like snap to that direction and the actor will move to it. This does not happens if I was touching the joystick and the the button. Its only if its the other way around.
    Can somebody explain me how to touch properly (lol)...
  • StusAppsStusApps Member, PRO Posts: 1,352
    I found that the best solution for me was to remove touch points 3,4 and 5. Then set the joystick to only work when collides with touch1 and the fire button when collides with touch2. I think the stick then had to be constrained only to touch 1x and 1y. The down side of this is that you must have your thumb on the joystick to be able to use the fire button, but thats what i wanted anyway.
  • StusAppsStusApps Member, PRO Posts: 1,352
    . oops double post
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Thanks Stus but the thing is that in my game I cant depend on having the thumb on the joystick all the time. Also I was only working with touch1, I deleted all the other touch. I just recently ad a touch2 to like to assign the fire buttons to it, to see if the problem get fixed but it didn't work.
    Who else, please, somebody help me, lets share touches experiences...
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Please anyone, I am stuck because I don't know how to touch correctly.
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Hello people I am going to my 3rd day without been able to resolve this problem. I am sorry to keep pushing this post but I am lost, I don't know what else to try, I really need help with this, please.
  • StusAppsStusApps Member, PRO Posts: 1,352
    If your stick is on the opposite side of the screen to your buttons then you could add a rule to make touch point 1 only be constrained when x<210 and touch 2 when x>210. That should stop button presses affecting the joystick.

    You stick should also be constrained to the position of the touch1 actor and not to the normal touch1.x and touch1.y attributes in the devices section.
  • LordTarantorLordTarantor Member, PRO Posts: 890
    thanks stus for your patience
    ok something happened the pressing of the button sis not calling the touch one to their side but the stick stop working.
    This is what I did.
    I put in the constrain to self.position.x to game.touches.touch1.x<210 ( is that is how I was supposed to doit?)
    And then for the second part in the stick in the big constraining rule I add the <210 after every game.touches.touch1.x
    is that is how I was supposed to do it, I think not, right?
  • LordTarantorLordTarantor Member, PRO Posts: 890
    Hey stus I been trying to work with what you told me but I cant figure where to put the<210 and how should I constrain the stick.
Sign In or Register to comment.