Hi! New to GDevelop and looking for some help with a bug in my game.
After two clicks, I am sending a sprite to a specific (x,y) location on a screen. I do this with both a left button and a right button. The general workflow is when a click on a button is released, it’s add to a ‘clicks’ variable for that button. When the ‘clicks’ variable hits 2, the sprite is sent off to the provided location and when it arrives the ‘clicks’ variable is set back to 0. The code is exactly the same for the left and right button versions of this (can see the code below).
The left version works great - on the second click it goes exactly where I want it to a resets. But the right version glitches and I can’t figure out why. After the second click it heads towards the location but when it gets to the x position of about 1120 (supposed to reach 1176) it starts vibrating in place and doesn’t move past that location without me hitting the right button again and manually moving it over to x=1176 (at which point the ‘clicks’ variable resets properly). I cannot for the life of me figure out why that would be and any help would be hugely appreciated.
I’ve added the code for moving towards the location. I can’t show the rest because new users can only add one image apparently but I can send over more if that’s helpful. The only part really missing is just that when the click is released on the right/left buttons +1 is added to the ‘clicks’ variable for that button (and the general move logic associated with the buttons).