Mar 26 2021 10:37 AM - edited Mar 26 2021 10:39 AM
Mar 26 2021 10:37 AM - edited Mar 26 2021 10:39 AM
I've been searching through the documentation and experimenting with several approaches, but I haven't been able to find an easy way to accomplish this.
Say you have a cube with all of the script components attached to allow the user to grab the cube with either hand and move it around (Box Collider, NearInteractionGrabbable, Object Manipulator).
How would you go about forcing the user to let go via code? Let's assume you've set a new Vector3 to the transform position on the cube to teleport the cube back to its starting location. How do you properly end the grab?
What happens is that after changing the cube's position in code it flys back into the user's pinched fingers like they have Jedi powers
I've tried two approaches so far to force the hand tracking to just let it go:
The problem is, the moment you either re-enable them or set the ManipulationType back to One and Two Handed... Force powers kick in and the cube flys back into your fingers.
I'm assuming this is because both the disabling/re-enabling or setting to none/setting back to both hands is occuring within the same frame.
So, the next thing I'm going to try is creating an action queue so that the re-enablement step (or setting ManipulationType back to both hands) occurs in the next frame.
Any thoughts though?
Is there some simple release() method that I'm overlooking?
Mar 27 2021 02:15 AM
Mar 27 2021 02:15 AM
SolutionMar 27 2021 02:15 AM
Mar 27 2021 02:15 AM
Solution