Standard for movement button events... (iOS)

I’m trying to do an iOS version of my game, and I’m currently adding the UI buttons for moving the character. I’m using event triggers - specifically OnPointerUp and OnPointerDown. They turn movement booleans on and off in my character controller code.

However, if I drag my finger from one button to another, it seems that the trigger keeps triggering the OnPointerDown of the first button rather than switching to the second button… is this method not correct? What is the normal way to get touch interaction working to move a player around?

Your mistake is the usage of OnPointerDown. It doesn’t mean, that it the finger is over an element, put it hit the an element, when the finger touched the display.

I made pretty much the same functionality, but I used just one sprite, not even a button. The classes you want to inherent from are: IDragHandler, IPointerDownHandler, IPointerUpHandler

And then just make a method to calculate where the touch input is compared to the center of your sprite, from that you can get a direction vector, which you can clamp to probably four directions in your case :slight_smile: