Jump to content

Attach object to object in VR


photo

Recommended Posts

Hello, everyone. How can I connect one object to another in VR? For example, insert batteries into a flashlight or plug in the socket. Found a similar mechanic in one of the demos where you have to put a wire in the fuse box, but I need both objects to be movable and hold them in your hands. Thank you!

Edited by Kabanero
Link to comment

Kabanero

That's very interesting and complex task in case of VR especially. We never did such motion before, so it would be hard to provide a ready-to-use code that you can simply copy and paste into your project.

However, you can experiment with a different approaches and maybe come up with your own solution. Here what we think may work:

  1. Connect objects via FixedJoint and somehow configure it so it would act normally with any mass and object shape.
  2. When you need to insert batteries from hand to flashlight simply switch parent of the object. It would be very simple solution with a visible jump in animation, but may work in some cases.
  3. Animate batteries via skinned animation when position of the object match the initial animation frame. So instead of actually inserting something you just play the predefined animation of this action.

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...