Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Splines control point Mixup with prefabs

I'm currently encountering a problem using splines in prefabs in Unity 5.3.1f1.
What I'm trying to achieve is making a prefab that contain a spline with two control points and a generator to have a road template.
I want to place that prefab all around the world, adjust the amount and position of control points to quickly make a road network and be able to adjust every road in one go easily by applying the changes on the original generator.

The problem is that when i use the prefab and extend the spline that it contain, the order of the control point mix up after i re open the scene.
Here is an exemple with a new spline without generator :

[Image: L4NAeqWk]

[Image: mlbyvUAF]

[Image: o7eGKHVA]

The problem seems to be much worse with the actual prefab i m trying tu use :

[Image: 7K0ROOYf]

[Image: CdkTZiTB]

Unity do not display any errors when this occurs.

Do you have an solution to avoid that issue or a workaround that can fit our workflow ?

in advance, thank you for your help.
Sounds familiar, but this bug should have gone some time ago. You're surely using the latest version (2.0.5) ?
Yes, i downloaded it directly from the asset store last week, and the ReadMe file in Package/Curvy have 2.0.5 in its version history
I'll investigate this...

I don't know how it progress with this bug, but we're working in a way that its not longer an issue.
I have other questions performance related.

We are trying to build project with curve and generator, and generate roads meshes along splines once when user start to play to keep APK size low.
But we have difficulties to control the generation of the roads, it seems that Curvy generate the roads and save it on the scene when we are building project, because disabling the script completely before building reduce a lot the APK size.
Is that a normal behaviour ? Or is there a way to control it other that disabling/enabling the gameobject parent of the generator ?

Also, when the game is running we have a lot of time spent by Curvy scripts (Curvy spline Update, curvy fixed and late update ...)
but we are not modifying anything during the game, so is there a way to control the updates of various curvy scripts other that disabling the gameobject ?
CG output is generated as soon as the setup is valid, so disabling is the way to go. Disabling the CreateMesh module only would be enough, though.

About CurvySpline performance: see if CurvySpline.CheckTransforms (Advanced section) is enabled and disable that. But Update()/LateUpdate()/FixedUpdate() is called for each spline each frame, but only the one in charge ("UpdateIn" setting) will actually call Refresh(). But Refresh() exits immediately if there isn't any Control Point set to a dirty state. If you profile Refresh() and it's actually doing something time-consuming, then you most likely have a script changing a property or transform of the spline or it's Control Points frequently.
allright ,

Thank you for all the new informations .
Examined the prefab/CP mixup issue:

Having a prefabbed spline...
* adding CP's to an instance is ok, but save scene & reload mixes the CP's not part of the prefab
* adding CP's to an instance and applying the prefab, then save&reload scene works

I'm not sure why this happens, it must be something with the way prefabs are handled by Unity.

Possibly Related Threads…
Thread Author Replies Views Last Post
Information New free asset: Converter For Unity Splines _Aka_ 9 26 05-17-2024, 09:35 AM
Last Post: _Aka_
  Twisting Splines ZiggZagg 6 11 05-14-2024, 04:48 PM
Last Post: _Aka_
  Help with procedural roads and splines ramiroflores 1 6 05-07-2024, 08:57 AM
Last Post: _Aka_
  Deforming prefabs with LODs along a spine LiveWire 4 12 05-01-2024, 04:53 PM
Last Post: _Aka_

Forum Jump: