I'm looking not so much for a throw as just maintaining motion after a ball is released by the hand in Hololens 2. Currently, I'm using the MRTK IMixedRealityTouchHandler
interface, mainly the functions public void OnTouchStarted(HandTrackingInputEventData data)
and OnTouchCompleted(HandTrackingInputEventData data)
.
On the Hololens 2 Emulator, when I release the ball with my hand (mouse), it drifts off in the air in the general direction I was pointing it towards relatively slowly, which is exactly what I want. I achieved this by reducing drag. However, once I build to the HL2 device itself, this motion is not emulated and the ball stops midair immediately after it is released. Why is this happening?
I've tried adding the line rb.AddRelativeForce(Vector3.forward * magnitude, ForceMode.Force);
in OnTouchCompleted
which wasn't successful. How can I maintain the ball's motion after it is released by my hand?