Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Position of Solver in Hierarchy
#2
(27-03-2024, 04:32 AM)vrtraining Wrote: Im using OBI Rope in Unity with XR Interaction Toolkit where user needs to grab the rope in VR and move it with hands (controllers). 

When Unity grabs any object it changes its position in hierarchy and move it to root, as soon as it happens OBI Rope stops working because there is no solver above in its hierarchy anymore. It only works if I put the OBI Solver directly on OBI Rope game object so when Unity moves it to root they are both moved together.

I have multiple ropes in a scene, I don't want to use multiple solvers (one solver for each rope) to maintain performance. What could be a solution that I can use one solver for multiple OBI Ropes without any order in hierarchy.

Hi,

You can't use XR Interaction components to grab a rope, for a very simple reason: they can only grab GameObjects and ropes aren't made of GameObjects but particles. To grab a rope, detect which particles are close to the player's hand and then override their position, you can do both using the particles API

This will not only allow you to use a single solver for all ropes, but also allow you to properly grab any point along the rope.

There's sample scripts included with Obi that show you how to use the API to interact with particles, for instance ObiParticlePicker/Dragger (which work by raycasting against the particles) and ObiContactGrabber (which works by grabbing particles that are in contact against a collider).

kind regards,
Reply


Messages In This Thread
Position of Solver in Hierarchy - by vrtraining - 27-03-2024, 04:32 AM
RE: Position of Solver in Hierarchy - by josemendez - 27-03-2024, 09:06 AM
RE: Position of Solver in Hierarchy - by ShawnF - 26-07-2024, 09:07 AM