02-05-2018, 05:19 AM
(01-05-2018, 06:08 AM)niZmo Wrote: Alright I changed some things up, and you were on the right track. Instead of using Linq, Obi has a new method for the constraints called GetFirstBatch(), but the real problem was the colliders hit registration.
Here is the updated code for ObiRope 3.4 and VRTK 3.3.0 alpha. I have also attached the files which is probably easier lol.
This has minimal functionality, a lot of things can be done like attaching 2 particles on grab so the rope doesn't rotate while grabbing with one hand.
Add this to the same gameobject as ObiSolver:
Add this to the same gameobject as your ObiActor:
Wow, thanks for the quick update!
The new code compiled fine but I still could not grab the rope that I created. I also tried it with the chain from the Chain scene in the Obi examples folder.
I used 004_CameraRig_BasicTeleport scene from VRTK as a base, added VRTK_InteractTouch and VRTK_InteractGrab to the controllers, and created a cube set with Windows->VRTK->Setup Interactable Object. Was able to pick up the cube fine with the grip button. I then created a Obi Rope (Fully set up), and added VRTK_ObiInteractableActor and VRTK_ObiInteractableSolver to it.
In the debugger I can see HandleGrabButtonPressed being triggered but isTouchingParticle seems to always be false. I put a break on HandleSolverCollision but it looks like the contact.distance threshold is never hit. I tried to bump up the collider size in VRTK_ObiInteractableSolver to 0.1 but that didn't help. I noticed that the VRTK_ObiInteractableActor was using ObiPinConstraints so I created some but was not sure what to pin them to.
Am I missing some other step?