Question How do I implement a Floating joystick?
I've been trying to implement a floating joystick for a day but the input system won't let me. I can either move the joystick or have ui button press detection, I can't seem to have both. What I'm thinking is happening is the input system selects the player action map and disables the ui action map which then stops any ui interaction. How do I solve this?
1
Upvotes
1
u/Czoks 4d ago
There is an example on how to set it up in Input System Samples.
1
u/Shoddy_Caterpillar36 PinePie | Asset Store Publisher 4d ago edited 4d ago
I have free joystick pack if you want. I made it when i was frustrated in implementing touch and those calculations.
Btw it is for 2d, but you can change axis.
PinePie joystick.
Oh missed the link, https://assetstore.unity.com/packages/tools/gui/pinepie-joystick-325958?srsltid=AYCX9vI0U0L0hfr3JdwzUGbYJ9_C1N1R9bpoubWlWm6E-SceIovjNMKp
Hope link works, otherwise search on google
1
u/johnv_dev 4d ago
you don't actually have to pick one. PlayerInput only keeps one action map on at a time, so either call Enable() on the UI map yourself after it switches, or leave the UI Input Module on its own default actions instead of your player asset. for the floating part, the built in On-Screen Stick has a Behaviour option called Exact Position With Dynamic Origin, which is basically a floating joystick already