Is object hit by a raycast...

Now i already know about raycasting and how i can control it and so on. I basically am going to have a whole bunch of raycasts projected at once and if the object isn’t hit by a raycast i want it to do something. any ideas. thanks ahead of time. (using javascript).

tainted

There are some possibilities.

You can simply make every raycast one after the other :

if (Physics.Raycast 1)
{

}
else if (Physics.Raycast 2)
{

} etc

You can also make a loop.

var hasHit : boolean = false;
for (var ray : Ray in rayList)
{
if (Physics.Raycast ray) hasHit = true;
}
//After the loop
if hasHit == true

no i am already casting the rays what i want to do is to have any objects know if they are hit by a ray. i don’t need the ray itself to know if it hit anything.

scenario:
say i have a bunch of cubes pouring in like water piling up. when some of the cubes get covered up by other cubes i want the mesh render to be turned off to save on the fps. otherwise with too many cubes it slows the computer way down. i just want say the cubes to know if a ray is hitting them, and one is isn’t turn them off.

?