Glitchy Set Graphic Flip

  • 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

  • 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?

  • @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.

  • @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.

  • Here's how I did it:

    Here's a link to the example project:

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

  • @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 :)

  • Heres the file once more Weird Glitch.tap

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

  • @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.

  • @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.

Log in to reply