Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Detect rope collision with raycast?
#1
Heya!
I have a line renderer which has a raycast following the rendered line.
I would like the rope to be cut where the raycast hits it (where they intersect eventually basically)

I currently have a script that cuts the rope at a hard-coded element for testing:

Code:
      using Obi;

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.T))
        {
            ObiRope rope = GetComponent<ObiRope>();
            rope.Tear(rope.elements[35]);
            rope.RebuildConstraintsFromElements();
   
        }
    }

But how can I detect a specific element by raycast hit?
And additionally, for future reference, it would serve me well to know how to do the same for collider collisions with the rope as well!

I've tried digging through the forums and documentation, but I'm either not looking in the right place, or don't understand things that might be common sense (like what are "particle1" and "particle 2" inside of an element and such, the documentation only says they're ints but I'm not sure what they do).
If there is a more in-depth walkthrough I can follow to educate myself with, aside from the 4 videos on YouTube, I would love that!
Reply


Messages In This Thread
Detect rope collision with raycast? - by Chironyx - 03-11-2020, 03:03 PM