ok, so a hardcoded or scripted ray function with recast, that irradiated through a set of rules for the recast somehow?
ie light bouncing, and picking up color, on each bounce or?
or a bullet going through multiple layers of objects, and then subtracting damage etc from each layer it pierced?
but somehow wrapped neatly so game/logic can handle it? …?
(thinking about it, creating a no collision item, that cast a ray, then moved there, then cast again the next frame based on rules may be the best option)
You can use recursion with a custom function using rayCastTo() and it’s hitPosition and checking for some criteria (no further objects to pierce) to stop the recursion.
You could also add an elongated cube (static, ghost) as the ray, then detect which objects are colliding with it, then determine the distance from each of those objects to the Player to determine which “layer” it is.