05-03-2024, 10:06 AM
I have a rope hanging behind some objects. Objects are between the camera and the rope.
The objects have an ObiCollider with category 0.
The rope has category 1.
I make a raycast from the camera towards the rope. I need the result to be returned only if it is not behind the object.
So I am creating filter as
int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 1);
var ray = _camera.ScreenPointToRay(Input.mousePosition);
solver.Raycast(ray, out QueryResult result, filter, 100f, 0.1f));
And unfortunately, every time I hit the rope, the result returns me the simplex of that rope. Even if she is behind an obstacle with ObiCollider. Is there a way for an obstacle to stop the raycast?
The objects have an ObiCollider with category 0.
The rope has category 1.
I make a raycast from the camera towards the rope. I need the result to be returned only if it is not behind the object.
So I am creating filter as
int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 1);
var ray = _camera.ScreenPointToRay(Input.mousePosition);
solver.Raycast(ray, out QueryResult result, filter, 100f, 0.1f));
And unfortunately, every time I hit the rope, the result returns me the simplex of that rope. Even if she is behind an obstacle with ObiCollider. Is there a way for an obstacle to stop the raycast?