Hey guys. I need help on a very difficult issue. I’m trying to make a sphere follow the surface of a mesh (see attached image). I need a system where the ball automatically follows the path (either by transform or rigidbody dynamics). I do not want to use splines. I think I need to get the tangents at the verts but I have no idea of how to achieve this. How can I get the sphere to follow the mesh surface? Thank you very much.
Interesting problem. I guess you need a solution that would apply for any mesh surface I suppose? I would also like to know how to achieve such a thing.
If it’s for just this mesh once, I would personally try the transform solution, e.g. place an array of transforms along the mesh for the ball to follow. Once the collider or Vector3.Distance(…) confirms ball is in range with transform, follow the next one until you get out of the curve.
I thought of it but haven’t implemented it yet because I’m looking to see if anyone has a much better method. These are the meshes I’m using. Thanks
Well it is posible to build a waypoint system that can do bezier curves, I’m sure there are systems to do this on the asset store as well.
I have attached a catmull-rom spline generator to the columns, and I’ll test it soon. Hopefully it gives the desired results.
You seem to making good progress but in case you have problems and need another solution the MegaShapes system on the asset store has a system that does just what you need, after a loft is generated you can move objects over the surface with just a couple of values, I am using it in my track editor and it makes life very easy. Second half of the video below shows the Walk Loft system. There are two versions of the walk loft one uses the actual vertices and faces in the loft and the other uses the splines used to create the loft which smooths out the discreet changes at face edges.