10-07-2023, 09:17 AM
Hi
This answer will only address the geometry/mesh aspect of intersections. If you are asking also about how to move objects along intersections, please do clarify this to me.
Curvy Splines does not have a feature that merges multiple extrusions (roads,tunnels, etc) in a way that handles the intersections properly. Here are some ways to work around this:
Did this help?
Have a nice day
This answer will only address the geometry/mesh aspect of intersections. If you are asking also about how to move objects along intersections, please do clarify this to me.
Curvy Splines does not have a feature that merges multiple extrusions (roads,tunnels, etc) in a way that handles the intersections properly. Here are some ways to work around this:
- Implement a custom mesh merging logic: When the Curvy Generator finishes generating, it (and the relevant modules) triggers an OnRefresh event. You can listen to that event to merge the generated meshes properly.
I believe the proper mesh merging logic might need to use Boolean Operations. This might be helpful:
https://stackoverflow.com/questions/5622...h-in-unity
- If the possible intersections are limited (for example only 90 degrees intersections), you can prepare a mesh per possible intersection, and then place those meshes at the intersections:
- When generating your tunnels, use the Range parameter in the Shape Extrusion so that the generated tunnel does not start at the intersection position, but a little further.
- Place the right pre-made intersection mesh in the empty space. A simple, no code method is to use a spline controller. Another method, using the API, is to use CurvySpline.Interpolate method (and GetTangent method to help orienting the mesh).
- When generating your tunnels, use the Range parameter in the Shape Extrusion so that the generated tunnel does not start at the intersection position, but a little further.
Did this help?
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.