I'm looking for some help with this. I'm very new to all of this development and trying to figure out how to set this up. (By the way, if this is the wrong place to ask this question, please direct me appropriately!)
I'm trying to build a very basic joystick (lollipop style, sphere with a cylinder) that I can click once to grab and move it around and get a numeric read-out based on how far in a given direction the joystick is pulled. If I pull my hand away from it too far, it should let go, or I can also click it again to let go. I was looking at scene 21 for reference, and I saw the lamp controller, but couldn't figure out the right kind of join and then how to get feedback for moving the joystick.
Could anyone offer suggestions or build a simple scene for me to pick apart to learn from? Thanks.
Think I would find this useful as well if anyone has any ideas how to go about it.
I just wrote a blog post explaining how I did it. Let me know if you have any doubts.
http://www.luispedrofonseca.com/unity-vr-joystick/
Is this issue open for someone add a similar thing as a core feature or is it just a reminder for a possible example scene feature? Else I would suggest closing this issue.
The blog post itself seems to be well done so anyone can replicate similar behavior to their project.
I provided an updated answer for the blog post the good sir provided above. It's just how to create a basic joystick, except I used a cube instead of a cylinder
I ended up getting the Joystick to work by just creating a cube and a sphere, both having rigid bodies, and the cube has the configurable joint with no object attached, I set the anchor to the center of the sphere by clicking Edit Joint Angular Limits, x,y,z motion set to locked; angular x,y,z motion set to limited, low / high angular x limit = -45/45 respectively, angular y limit = 45, angular z limit = 45.
Then I attached a VRTK_Rotator Track Grab Attach script to the cube
then I attached a VRTK_InteractableObject script to the cube with "Is Grabbable" checked and the VRTK_Rotator Track Grab Attach and the primary grab attach mechanic.
also the sphere has position restraints for x,y, and z axis. and I unchecked Use Gravity for both the sphere and the cube, and I checked Is Kinematic for the cube
Most helpful comment
I just wrote a blog post explaining how I did it. Let me know if you have any doubts.
http://www.luispedrofonseca.com/unity-vr-joystick/