03-11-2020, 03:03 PM
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:
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!
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!