Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Move spline attached to gameobject.
#6
In this post, I will give an explanation to your performance issues, and then a workaround.

The explanation: The curvy generator does virtually nothing until one of its inputs changes, at which point  it generates the related data. In your case, changing the world position or rotation of the spline makes the spline notify the generator that it has changed, even if the changed information (the world position) is irrelevant to the generator, thus making the generator regenerate everything at each frame. I need to work on a smarter way to keep track of changes, one that makes the distinction between irrelevant changes and relevant one. So until such thing is released in an upcoming update, here is ...

The workaround: Disable the "Check Transform" setting in your splines. This will stop the splines from being updated automatically  (in play mode). You will then need to make them update whenever you change their shape by calling the Refresh() method. Here is an example where I update the position of the last point of a spline:
Code:
curvySpline.ControlPoints.Last().localPosition += Vector3.forward;
curvySpline.Refresh();

Your issue with the spline lagging by one frame might also be fixed by the Refresh call.

If you still have performance issues, and made sure you don't generate unnecessary data for your use case (colliders, normals, tangents, etc), you can send me one of your scenes so I can profile it and pinpoint where the performance issues come from.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
Move spline attached to gameobject. - by Juwdah - 01-24-2018, 11:41 AM
RE: Move spline attached to gameobject. - by _Aka_ - 01-24-2018, 08:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: