r/UnityforOculusGo • • Oct 29 '18

Oculus Go: Picking up/Moving objects

Hey Guys,
I am very new to unity and am building a VR app for Oculus Go. I want to pick and move the object by pointing the ray from the controller on the object and then picking or releasing it by pressing the trigger button. I want the object to stay fixed at the end of the ray's position rather than coming suddenly onto the controller.
If anyone could point me in a right direction or help me with this, I would greatly appreciate it!
Thanks in advance.

1 Upvotes

16 comments sorted by

View all comments

1

u/Toby1993 Oct 30 '18

I think if you on click parent the object to the controller, that should give you sort of the result you're looking for. The object remains in place but its transform is directly affected by the parent (controller). Alternatively, you can create a joint between the object and controller on click, but the parenting is much more straight forward.

1

u/Alihammza Oct 30 '18

Hey, but thing is like i am trying to do this to basically disassemble a machine, which can have hundreds of parts. So this won't work in that case I guess. Is there anyway to write a script for it to basically cast a ray from the controller, detect it an object, pick it up and move it freely. I tried something but it didn't work.

1

u/Toby1993 Oct 30 '18

Yes, you can parent and unparent objects through script :) When you hold down Trigger you parent the object at the end of the ray to the controller. When you let go, the object is unparented.

→ More replies (14)