Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
In Game Roads - Curvy Generator Prefab?
#1
Lightbulb 
Hello,

I'm using curvy to allow construction of in-game roads over terrains.  I was wondering your suggestion for best approach to the Curvy Generator.  (I'm very comfortable with API access and run-time creation of game object hierarchies.)

Specifically, each road will need to have a curvy generator that is basically the same.  1 road = 1 spline, yes they will be able to connect in many ways.

Should I have a curvy generator prefab that is set up with everything I need (conform path, correct shape extrusion for the roads, etc.) and just GameObject.Instanciate that prefab when I have a spline I want to "turn into" a road?

If that isn't the best way to do it, what would you suggest?

Thanks!
Reply
#2
Hi

The solution you suggest seems good.

About roads intersection, please read this post to know about Curvy's limitations in this field.
https://forum.curvyeditor.com/thread-127...ml#pid4551

Please let me know if anything is unclear.

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.
Reply
#3
Thanks for the reply and pointing out the road overlap thing - it shouldn't be a problem for my application.

Another approach I thought of was having one generator that could take in a dynamic spline and create the mesh, then copy that mesh at run time (much like the "export to scene" button you have in the inspector graph GUI) and then remove the input spline from the generator (so there are not two meshes). There would certainly be far fewer game objects with that approach.  I expect to have hundreds of splines turned to roads through the course of playing a scenario in the game. Having a generator for each one after it's been placed and finalized doesn't make much sense unless there is something I'm missing?

Thoughts on that?

Thanks again!
Reply
#4
Yes, keeping only the exported meshes is a good idea.
You can leave the input spline in the generator, but disable the generator instead. It will be easier to reactivate this way.
I guess you can use Unity's API to detect when when entering/exiting play mode, and use that to execute the operations we spoke about.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 0 0 1 hour ago
Last Post: ShiroeYamamoto
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 4 Yesterday, 07:25 AM
Last Post: amutp
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 0 6 Yesterday, 03:23 AM
Last Post: _Aka_
  Generating GO only on CPs in Generator GameDeveloperek4123 1 6 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: