Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Raycasting rope behind an object
#1
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?
Reply


Messages In This Thread
Raycasting rope behind an object - by Apoll0 - 05-03-2024, 10:06 AM
RE: Raycasting rope behind an object - by Apoll0 - 05-03-2024, 11:14 AM