Greetings;
I was working on a script that uses a raycast to know whats on a certain direction.
I was wondering about if I could get an array of all objects that the raycast hits.
So, I don’t really know how to code this, but when using a standard raycast you usually have something like:
var hit : RaycastHit;
if (Physics.Raycast (transform.position, -Vector3.up, hit))
{
// some actions.
}
What I would like to do is something like:
var hit : RaycastHit[B][][/B];
if (Physics.Raycast (transform.position, -Vector3.up, hit[]))
{
for (var foo : RaycastHit in hit)
{
// some actions depending on foo collider
}
}
Is there a way to do this? Or raycasts just returns the very first collider?
Thanks in advance