How? Button widget that moves like joystick?

Best example: its pretty simple to visualize but to explain its tricky, I’m looking for a way to add a button similar to the left and right joystick for my game but its used do other functions

i have a middle button widget set up so if “press” it drops a bomb but im trying to make it so that if i press and hold and swipe up,down,left or right it throws it in that direction?

on press drop yeah that’s fine, but on held down and released at the right i would like it to fire grenade to the right without having to use the other joystick pretty much need to make my own joystick with a button that can be pressed and can move even if its slightly so it knows which direction is triggered

331492-untitled.png

What’s the input? Mouse, keyboard, a controller, something else? How are you going to operate this?


Generally speaking you place something in a canvas and move the slot the canvas creates.

If I wanted to move in a somewhat circular fashion, I’d get the input from the device (direction & magnitude) and rotate a 2d vector in the widget - place the canvas slot there.

So let’s say I (Press & move the widget button right) “virtual joystick style” on release at “…” angle set angle of (character socket) and trigger the event on release

  1. Joystick style widget
  2. Press button (do something)
  3. Press and move widget location = (set socket rotation to match (like Virtual Joystick)but only “print string” fire event on release with the character socket facing that direction …
  4. After all that reset rotation of character socket to default
  5. Set widget button to default

After writing that it seems much more simplistic I just need to know how to rotate the widget button in a circular motion like the virtual joystick.