Is there a way to check if a ray cast through an area(not collider)

I just want to check if the ray touch the area declare by distance(vector3) and size(vector3),because I don’t wan t to use gameobject and boxcollider to waste performance.

The Bounds struct has an IntersectRay method which does the math for you:

1 Like

really really thank you my friend! solve all of it~