Unfortunately general Unity Physics rules apply here, since BoundingBoxFollower
creates and updates a PolygonCollider2D
collider, it will only interact with the 2D physics subsystem. Creating a 3D MeshCollider instead (an extruded polygon) is also not trivial, since it needs triangulation of the outline's vertices to work.
Easier solutions would be to either:
- a) Manually create 3D BoxColliders and let them follow bones to interact with the 3D Physics raycast.
- b) Since your Spine objects seem to be on the same Z plane: calculate the ray-intersection point of the ray and this plane, and then use
Physics2D
queries to determine if e.g. a circle lies within the 2D collider.