i need to shoot a ray from a point to the ground( a box ). but sometimes there could be some unexpected objects getting in the way of the ray. I need to let the ray cast as if the unexpected objects never exist.
is it possible? please advise.
How to cast rays through an object
Re: How to cast rays through an object
That post is about getting the entity hit by a ray cast in v1, but it doesn't cover filtering considered bodies, which sounds like what you actually want.
In v1, Space.RayCast takes a delegate that can be used to filter out unwanted candidates.
In v2, the IRayHitHandler you pass to the Simulation.RayCast function has AllowTest callbacks you can use to reject objects before testing.
In v1, Space.RayCast takes a delegate that can be used to filter out unwanted candidates.
In v2, the IRayHitHandler you pass to the Simulation.RayCast function has AllowTest callbacks you can use to reject objects before testing.
Re: How to cast rays through an object
Thanks. It works.Norbo wrote: ↑Sat Feb 29, 2020 8:02 pm That post is about getting the entity hit by a ray cast in v1, but it doesn't cover filtering considered bodies, which sounds like what you actually want.
In v1, Space.RayCast takes a delegate that can be used to filter out unwanted candidates.
In v2, the IRayHitHandler you pass to the Simulation.RayCast function has AllowTest callbacks you can use to reject objects before testing.