GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Simple button not working

Quite frustrated, I have a button that says to change to the next scene when pressed, works perfectly on my computer. I have published the app to the google play store and when I try to play the game on the galaxy phones, the button doesn't work. I have updated the app trying multiple things, sending it to the front, changing "pressed" to "released" etc. I believe this is an android problem but not sure, because at one point it was working, and without changing any of the code for that button it stopped working. Just frustrated because I know it should be working, looking for any advice to fix it.

Thanks!!

Answers

  • ThoPelThoPel GermanyPosts: 184Member, PRO

    Hard to say without the code or any screenshots :smile:

  • FaarisFaaris Posts: 66Member, PRO
  • ThoPelThoPel GermanyPosts: 184Member, PRO
    edited July 2015

    @Faaris Okay, it looks good.

    In your place I would check the first rules on the scene "Score". I had a similar problem - with a non working button - and it was due to a mathematical function on the following scene. The GS preview worked, but on the iPhone it crashed. I just looked in the wrong place for hours :neutral:

  • FaarisFaaris Posts: 66Member, PRO

    Here is the code for my score variable, but the weird thing is that my button works on my android tablet but not any of the android phones

  • SocksSocks London, UK.Posts: 12,822Member
    edited August 2015

    What does "the button doesn't work" mean in this context.

    I'd always recommend that people say what does happen rather than what doesn't happen in problem solving situations like these, 'it's not working' could mean all sort of things, it could mean the button doesn't show up on screen, the button doesn't take you to the next scene, the button doesn't reset the game.score to 0, the button does reset the score to 0 but the game freezes when it takes you to the next scene, the button takes you to the next scene but the score is stuck at 0 (etc etc).

    'it doesn't work' often feels like feedback, but it's actually a lack of feedback . . .

    "I'm trying to add 5 and 5, a simple sum you'd think, but it doesn't work."

    Not a lot you can do with that . . . here's the what-does-happen (rather than what doesn't happen) version . . .

    "I'm trying to add 5 and 5, a simple sum you'd think, but I keep getting 25"

    With the second version you can reasonably guess that there are accidentally using multiply instead of plus . . . even if the information is simply 'the button appears, but it doesn't go to the next scene when I click on it even though the score resets' or 'the button appears and when I click on it the score doesn't reset' - it's much more useful than describing what is not happening.

    Hope that makes sense !! :smile:

    . . . . . . . . . . .

    Why do you have your change game score to 0 below the change scene behaviour, are you wanting to change scene first ?

  • FaarisFaaris Posts: 66Member, PRO

    @Socks By 'the button not working', I mean it does not change over to the next scene Thanks

  • SocksSocks London, UK.Posts: 12,822Member
    edited August 2015

    @Faaris said:
    Socks By 'the button not working', I mean it does not change over to the next scene Thanks

    That's just another example of what doesn't happen ! :tongue: :wink:

  • FaarisFaaris Posts: 66Member, PRO

    @Socks ok so how do I fix it

  • SocksSocks London, UK.Posts: 12,822Member

    @Faaris said:
    Socks ok so how do I fix it

    When you press the button what else is happening in your scene ? Or is the scene just a single button ?

  • FaarisFaaris Posts: 66Member, PRO

    @Socks nothing else, it's a still picture, the scene is just a button

  • SocksSocks London, UK.Posts: 12,822Member

    @Faaris said:
    Socks nothing else, it's a still picture, the scene is just a button

    Are there any rules in the next scene (scene 2) that would potentially return the player to scene 1 (the button scene).

  • FaarisFaaris Posts: 66Member, PRO

    @Socks nope, scene 2 is just a gameplay scene

  • SocksSocks London, UK.Posts: 12,822Member

    How do you get to scene 1 (the button scene) ?

    I'm assuming something must happen prior to scene 1, as you are changing the game.score from something-other-than-0 to 0 ?

  • FaarisFaaris Posts: 66Member, PRO

    @Socks it's actually the starting scene. I just change the score to 0 to make sure the game doesn't continue from where the player died

  • SocksSocks London, UK.Posts: 12,822Member

    @Faaris said:
    Socks it's actually the starting scene. I just change the score to 0 to make sure the game doesn't continue from where the player died

    Is it possible to go from where the player has died to scene 1 ?

  • FaarisFaaris Posts: 66Member, PRO

    @Socks nope

  • FaarisFaaris Posts: 66Member, PRO

    @Socks as soon as the player dies, it goes to a gameover screen where the player can retry

  • SocksSocks London, UK.Posts: 12,822Member

    Make a copy of your project (so you don't ruin your real project!) - delete all the scenes except for scene 1 (the button scene), then make a new scene 2 - change something obvious (so you can tell you are on scene 2), like change the BG colour to yellow . . . . go back to your button rules in scene 1, change the 'change scene' behaviour so that it points to this new scene 2 - don't change anything else, leave everything else in the button rules as it is . . . .

    . . . . then see if the scene change takes place.

  • FaarisFaaris Posts: 66Member, PRO

    @Socks yes the scene change still took place

  • FaarisFaaris Posts: 66Member, PRO

    @Socks yes the scene change still took place

Sign In or Register to comment.