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

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.
Reply
#2
Sounds familiar, but this bug should have gone some time ago. You're surely using the latest version (2.0.5) ?
Reply
#3
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
Reply
#4
I'll investigate this...
Reply
#5
Hello,

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 ?
Reply
#6
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.
Reply
#7
allright ,

Thank you for all the new informations .
Reply
#8
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to generate gameobject on the control point Yang Yi 1 6 Yesterday, 10:14 PM
Last Post: _Aka_
  CurvyConnections inside prefabs CoolUser 9 3,884 10-02-2024, 06:41 PM
Last Post: _Aka_
Information New free asset: Converter For Dreamteck Splines _Aka_ 0 0 07-19-2024, 08:27 PM
Last Post: _Aka_
Information New free asset: Converter For Unity Splines _Aka_ 20 61 07-19-2024, 05:15 PM
Last Post: _Aka_

Forum Jump: