Search Unity

[Oculus Go / Gear VR] - Throwing objects with controller

Discussion in 'AR/VR (XR) Discussion' started by Martin_H, May 28, 2018.

  1. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,826
    I'm working on a throwing knives game for the Oculus Go. I want to use the 3DOF motion controller that comes with the device to be used to give part of the inputs that the player uses to throw knives (or potentially other objects too). There is a fairly big disconnect between the direction I feel I'm aiming at, and the direction the knives go, and I think that's due to technical limitations of how the hand position is interpolated from the limited input values (just controller rotation afaik). I do not want this to be something that you aim with a crosshair, I want this to be a high skill-ceiling thing that can be improved through practice, which is why I want so many dimensions of input data (look-direction too to a degree) to influence the throw.

    I believe I have a chance to improve the experience by re-doing the way the "hand tracking" works and moving the hand that is holding the knife more in front of your face, so that you can see the angle it's moving at and it's not originating so far off-center from your view. Is something like this frowned upon in VR design guidelines? Or can I reasonably expect players to adjust their own hand to better correspond to the ingame hand? Should I be concerned about people whacking themselves on the nose (or headset) with something like this?

    I don't want to entirely lose the familiar motion tracking feel for immersion reasons, so I was thinking of maybe using the touchpad being touched or not as a switch to smoothly interpolate between "aim tracking" and "regular tracking". Thoughts on this?

    Currently pressing the trigger spawns a knife in your hand, and releasing it disconnects the object from the ingame hand and deactivates the .isKinematic property of the rigidbody and applies forces. My reasoning is that throwing any real object, you'd "let go" at the moment of the throw. Am I right here or are players likely to expect spawning a knife to go automatically and releasing it to be done with the trigger pull like a shot? Is there any convention for this mechanic in VR games?

    I'm sure I can figure out the implementation for these things, but I have no experience whatsoever designing for VR, so I thought it's worth asking for your thoughts.
     
  2. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,506
    That's probably a question best asked to Oculus directly since they might reject your app for not subscribing to their IK. When you are using either the Unity API or Oculus API it uses the IK soluition that Oculus baked right into their SDK. It is derived from the orientation but mimics an average human frame and simulates a sholder and elbow. Another problem you might run into is performance, both the HMD and controller have special places in the frame life-cycle to try and grab the most up to date info right before rendering, it's pretty close to the end much later than the normal spot of the Unity update cycle. So if you unroll theirs and do your own you will be doing it on the normal spot in the update cycle and if your game doesn't quite make the 60 fps you might notice a lag.

    I've found throwing "ok" in my product (as much as can be expected in a 3DOF controller). If Oculus comes back and says theirs is required you might want to think about doing some smoothing right before the release or perhaps average the last few frames.
     
    Martin_H and Arkade like this.
  3. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,826
    Good idea! I think I'll experiment with it, but keep it optional so that I can easily take it out again if needed.

    Thanks for all the info! Didn't know about all the special hoops they jump through.

    Did you ever try if you are able to hit the same spot several times in a row when throwing objects?

    I haven't done all the fine tuning yet but as a test I did a last 5-frames average and that already felt considerably better. I will do some further hacks to make it more intuitive. I think I'll tie the left/right aim stronger to the view direction and the up/down aim stronger to the throw force. That should make it easier to get reliable results even if you can't see your hand and the tracking is slightly off.


    By the way I would recommend adding a demo video to your asset's ( https://www.assetstore.unity3d.com/en/#!/content/88829 )page and a link to the documentation PDF in the product description.
     
    greggtwep16 likes this.
  4. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,506
    A fairly large target yes. If you mean something as precise as darts then no I would imagine it's never going to be that accurate. It all depends on the motion and accuracy needed by the game. I think there is a reason disc league is one of the few games with these type controls on the store and I would think that has mostly to do with a Frisbee motion being easiest to track with only orientation since it's all in the wrist. Hence frisbee, a shovel pass, underhand toss, etc, would be most accurate and something like darts where orientation barely changes would be most difficult. A normal overhand throwing motion would be somewhere in the middle with a decent amount of orientation change due to the arc introduced by our arm length.
     
    Martin_H likes this.
  5. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,826
    I agree. After testing some more and experimenting with "fading in" a view-direction based aim assist based on how close the throw vector already is to the view vector I have come to the conclusion that it isn't really fun. Either you aim fully with the view and feel the strong disconnect in the throwing motion, at which point you have to question motion control for throwing altogether, or you do it without aim assist, where it is unviably hard to control. And the fading in doesn't work because it feels confusing and inconsistent.

    I'm leaning towards trying something ballistic next, like a crossbow or bow.

    @JoeStrout: how's the bow-game coming along?
     
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,058
    Just fine. Don't steal my idea! :p

    (Even though I totally stole it from Valve... but it's not my fault they're not making it for other platforms!)
     
    Martin_H likes this.
  7. GKlimenko

    GKlimenko

    Joined:
    Jun 13, 2018
    Posts:
    2
    Hi, Martin! If it's still possible can you explain how to throw objects with GesrVr/Go, please?
    So far I can pick up object and drop it. That's it.