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
  Curvy does not like Unity 2021.3 (Attribute Conflicts) KasimirBlust 2 6 01-27-2023, 09:23 AM
Last Post: _Aka_
  building game changes UV spaces for generated mesh scr33ner 9 11 01-18-2023, 09:16 AM
Last Post: _Aka_
Information Curvy 8.4.0 is live _Aka_ 0 3 12-13-2022, 05:27 PM
Last Post: _Aka_
Exclamation Stack overflow when editing prefab containing splines rhys_vdw 4 11 11-30-2022, 11:38 AM
Last Post: _Aka_

Forum Jump: