Hello,
how can I force the raycast alghoritm to ignore particular objects in world?
My scenario is: I have a ball which position is bound to camera position. Therefore, if I raycast exactly from camera position - it will hit the ball within the camera is.
Ignore particular objects when doing RayCast
-
- Posts: 4
- Joined: Thu Jan 29, 2015 7:04 pm
Re: Ignore particular objects when doing RayCast
Use an overload which takes a filter delegate, or use the overload which returns multiple hits and manually filter the results.
For example:
For example:
Code: Select all
var filter = entry => entry != ThingThatShouldNotBeDetected;
Space.RayCast(ray, filter, out result);