Problem with button touches not working on IPad

ErisedErised Member Posts: 21
edited November -1 in Working with GS (Mac)
I designed my controls first with the keyboard, since I had not paid to be able to test on my devices. After that, I added buttons for left, right, fire and jump. In each button, I changed a game attribute that I had created for that button to true. For example, there was a game attribute called fire button pressed. I set it so that this attribute would be changed to true when the actor received a touch event. Then, I altered the firing command on my player so that it would activate either through a key press, or fire button pressed being true. It works properly in GameSalad preview, but when I actually previewed it on my IPad, the buttons are not working at all.

i have double checked every rule I have used, and they all seem to be correct. Any idea what might be causing this would be greatly appreciated.

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Did you delete the rules for the keyboard commands after you made the on touch rules?
  • ErisedErised Member Posts: 21
    No, I set it so that the rules occurred if either the key was pressed, or the attribute was true
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    There's probably a conflict with doing that. I may be wrong, but it sounds like the touch rules are being overridden by the keyboard commands.
  • AsymptoteellAsymptoteell Member Posts: 1,362
    Do you have any otherwises in those rules?
  • ErisedErised Member Posts: 21
    I use an otherwise to shoot left instead of right, based on which way the character is facing, but that is part of a rule that is within the rule I am speaking about. Basically, The top layer of the rule is if any of the following is true: keyboard m key is pressed, or game attribute fire button pressed is true. The behaviors inside this rule are to spawn the weapon fire actor going one direction if the player is facing right, with an Otherwise to make it spawn the actor going the other direction.
  • ErisedErised Member Posts: 21
    I just took out the keyboard commands and tested it again, and it still does not work. It works with the mouse clicking on the button in GameSalad itself, but not with touching the button on the ipad.
  • MotherHooseMotherHoose Member Posts: 2,456
    ok on the fire button....

    Rule when touch is pressed
    --Rule when actor is Left
    ---spawn WeaponFire to left
    ---Otherwise: spawn actorWeaponFire to Right

    ===
    How are you triggering the change in the gameAttribute boolean "Fire button pressed" to true/false?
    and don't think you need that attribute... as the button only fires when pressed.

    MH
  • ErisedErised Member Posts: 21
    I have the firing triggered within the player actor, which is why I set a game attribute for the button being pressed. For the button, I have it set to change the attribute to true when touch is pressed. In the player actor, I have the firing rule set to occur when the boolean attribute is true. I thought about putting the firing sequence into the fire button, but was not sure how to link it properly to the player actor. What direction it fires is based on what direction the player is facing, which is based on which image is currently displayed. And it has to fire from the player's current location, and be able to be done while moving.
  • MotherHooseMotherHoose Member Posts: 2,456
    okay...

    you are going to have to click on the button that you have in the scene and unlock it and edit that instance...

    Rule when touch is pressed
    --Rule when
    ---Attribute: [...] CurrentScene > Layers > layer your Actor's on>playerActor > Image | is | FullNameOfYourLeft.png
    -----do Left fire..
    ---Otherwise:
    -----do Right fire

    will save you and device some effort...

    MH
  • ErisedErised Member Posts: 21
    ok, I see what you mean, but how do I have it start firing from wherever the playerActor is at the time? Would I need to set a game attribute and constrain it to the playerActor's location?
  • ErisedErised Member Posts: 21
    Hmmm, I don't see how to refer to the other actor from this one... I don't see the CurrentScene option.
  • ErisedErised Member Posts: 21
    Never mind, I see it now, I was in the global actor, instead of the instance of it on screen. Thank you for all of your help so far. Now that I see how to refer to another actor, I can figure this out.
  • ErisedErised Member Posts: 21
    ok, I did this, and it still works with the mouse click in Game Salad, but when I test it on the ipad nothing happens when I touch the button. Any ideas?
Sign In or Register to comment.