First a little background. I’m trying to define bounds for a 3D race track. I have 4 3D meshes that form a rectangular tube (It’s always going to be a rectangular shape). I’m casting rays from the character Up, Down, Left and Right.
RaycastHit l = CastRay (m_FollowObject, Vector3.left);
RaycastHit r = CastRay (m_FollowObject, Vector3.right);
RaycastHit u = CastRay (m_FollowObject, Vector3.up);
RaycastHit d = CastRay (m_FollowObject, Vector3.down);
Using the l.point, r.point, u.point, and d.point I want to find the centroid so that I can figure out where the center is to properly place the camera. Does anyone know how to do that?