- Home /
The question is answered, right answer was accepted
[Solved] SteamVR 2.0 Unity Plugin scale gameobject with 2 hands
Hey guys,
I'm using SteamVR 2.0 Unity Plugin and I want to scale and rotate objects in my scene by grabbing one object and then grabbing it with the other hand, like it is in the Steam VR Home scene, when you grab and scale one of the placed objects in the shelfs.
Does SteamVR 2.0 Unity Plugin has something for this already? Also, using VRTK is not an option because it does not support it.
Answer by unity_J016ZU_VZQzYAg · Feb 20, 2019 at 03:47 PM
I did it on my own.
hello @ unity_J016ZU_VZQzYAg, the code works almost perfectly, scales correctly staying in the correct position, but when you finish and drop the object, it moves to a far direction. I think the problem may be this part of the code
attachedObject.transform.position = (0.5f (currentHandPosition1 + currentHandPosition2)) + (handRot (initialGrabDirection * p));
initialGrabDirection does not exist before, for it to work I had to replace it with initialObjectDirection, but when the object is released it moves to an erroneous position.
Answer by FloAtm · Feb 07, 2019 at 07:12 PM
Hi @unity_J016ZU_VZQzYAg , did you solve this issue? I upvoted, but didn't manage to find an own solution... Can you share your way?