Add virtual joystick input
See original GitHub issueIssue Description
Visually, it should look similar to this.
First, the API design should be proposed based on what information we want to obtain from the joystick. Presumably, we want a vector from the joystick center to where the player pointer (finger / cursor) is, when the joystick is being pressed. Using the vector we can obtain both the direction and length (magnitude that we can use to estimate force).
Edit: functionality is there apart from force, which needs to be calculated and obtained via vector
before this is closed.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Mobile Virtual Joystick Movement with Unity's Input System
My game is using the Unity Input System package, which has a pair of very easy-to-use scripts for on-screen touch input. If you...
Read more >Create two virtual joysticks (touch) with the new input system
So, as the title says, I'm trying to create two virtual joysticks (one for aim, one for move). I have noticed that there's...
Read more >On-screen Controls | Input System | 1.0.2 - Unity - Manual
For example, if one on-screen button references <Gamepad>/buttonSouth and another on-screen button references <Keyboard>/a , the Input System ...
Read more >How To Add Multi-touch and Virtual Joystick Controls
Create a new object; Make it a child of obj_ui_parent; Define the input(_touch_id, _touch_x, _touch_y) function; Make that function do whatever ...
Read more >Advanced Features - JoyToKey
Virtual joysticks (a.k.a. SHIFT-key function). Assume your joystick has only 6 buttons, but you want to assign 10 different key inputs to your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, sounds good, you should be able to use the
pressedProperty()
of theParent
(whichVirtualJoystick
is) to see if the foreground circle should be moved to where player input (cursor or finger) is.Maybe something like this (I call foreground inner for conciseness)
Not sure how whether the above will work for multi touch screens (e.g. on mobile), but it’s a start.
Good stuff! 😃