logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Glitchy Set Graphic Flip

    Scheduled Pinned Locked Moved
    Help and Support
    3
    11
    224
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SplitMindGamingS
      SplitMindGaming
      last edited by

      I created a very simple file to showcase this little glitch that im having a hard time fixing. Basically i created a whole screen button for a character to float left and right. Had it set up the flip the graphic to face the direction hes floating. But when i click on both buttons at the same time. He starts glitching left and right really fast like hes twitching. Now i know this is expected as the system doesnt really know what direction you want him to face. But how do i fix this so that doesnt happen? File included. All the coding is located on the Scene ui layer under game logic.

      To control touch the left side of the screen to go left. Right side of the screen to go right. To replicate the problem im having. simultaneously press both the left and right side at the same time. You will see what im talking about. If you know a fix please add the code to the file and reshare it here if possible. Thanks so much.Weird Glitch.tap

      1 Reply Last reply Reply Quote 0
      • Aidan_FireA
        Aidan_Fire
        last edited by

        You ask how do you fix this so it doesn't happen. What exactly do you want to happen when you press both sides? Do you want say one side to always override the other?

        SplitMindGamingS 1 Reply Last reply Reply Quote 0
        • SplitMindGamingS
          SplitMindGaming @Aidan_Fire
          last edited by

          @Aidan-Oxley i actually want another animation to happen when both sides are pressed. An animation of the character looking up only if it detects when both sides are pressed at the same time. If this cannot happen. I wouldnt mind one side overriding the other just to stop the glitching effect.

          MelideM 1 Reply Last reply Reply Quote 0
          • MelideM
            Melide @SplitMindGaming
            last edited by

            @SplitMindGaming For this I would use a Value behavior. When you press one button it add 1 to the Value, and when the Value is equal to 2, it means that both buttons are pressed at the same time. Don't forget to subtract 1 when you stop touching one button.

            1 Reply Last reply Reply Quote 1
            • Aidan_FireA
              Aidan_Fire
              last edited by

              Here's how I did it:
              3BEFF46B-356D-43DE-841B-E9245E5F1541.png

              Here's a link to the example project: https://go.aws/3cYIJ55

              SplitMindGamingS 3 Replies Last reply Reply Quote 0
              • SplitMindGamingS
                SplitMindGaming @Aidan_Fire
                last edited by

                @Aidan-Oxley thank you for that. Its exactly what i was looking for.

                1 Reply Last reply Reply Quote 0
                • SplitMindGamingS
                  SplitMindGaming @Aidan_Fire
                  last edited by

                  @Aidan-Oxley hey so ive been trying to get your file to work with the one i provided. For some reason i cannot get it to work when dealing with while touching. I can get it to work with started touching but the moment i use while touching for the apply force effect the process breaks. On file i provided. Are you able to get it to work With what you came up with. I know it on my file it flips the graphic either right or left. Maybe while pressing both you can have it show a complete different graphic to symbolize that both buttons are being pressed together. Please if you can show it how its done with the while touch behavior I will be your best friend :)

                  1 Reply Last reply Reply Quote 0
                  • SplitMindGamingS
                    SplitMindGaming
                    last edited by

                    Heres the file once more Weird Glitch.tap

                    1 Reply Last reply Reply Quote 0
                    • SplitMindGamingS
                      SplitMindGaming @Aidan_Fire
                      last edited by

                      @Aidan-Oxley actually disregard my previous message. I just figured it out :)

                      Aidan_FireA 1 Reply Last reply Reply Quote 0
                      • Aidan_FireA
                        Aidan_Fire @SplitMindGaming
                        last edited by Aidan_Fire

                        @SplitMindGaming Ok. I read them anyway :P you could've just added these started/stopped touching behaviours in anyway as extra logic apart from your while touching stuff. What did you do to get it working?

                        The reason it broke I imagine is because I'm using add/subtract values. When you use started touching it adds up once, when you use while touching it adds up 60 times per second and yeah that would break it. Another thing you could do is remove my add/subtract values and replace them with set Input Field to 1 or 0 of the box container, if this makes sense.

                        SplitMindGamingS 1 Reply Last reply Reply Quote 1
                        • SplitMindGamingS
                          SplitMindGaming @Aidan_Fire
                          last edited by

                          @Aidan-Oxley Yes i actually just kept everything you had. But added the while touching on top of it with only the specific controls to those events. That way the started touching can handle all the coding events to input the graphic flip or animations and the while touching to handle the actual character movement.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post