Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deleting a curve make me very slow
#1
Hello every one,

I have an issue when i want to delete a CurvySpline i've created at runtime. When the spline have many controlPoints the destroy function is kinda heavy to
run. it even some times forced me to shut unity process because the editor don't answer anymore. Do you guys have any idea why ?

Thanks
 
Reply
#2
Hi,

I got some questions:

- what is "many ControlPoints" for you? 50? 100? 1000?
- Do you delete the spline by calling GameObject.Destroy()?
- If you call CurvySpline.Clear() before deleting the spline, does this make a difference speed-wise?

The only performance issue in deleting splines *should* be the destroying of the CP's GameObject.

Jake
Reply
#3
Hi,

Thanks for your answer.
It is around 50 points and less.
To delete the spline i use CurvySpline.Destroy()
I've tried with adding Clear() but it did not changed anything.
The Odd one is that i've exported my code in an other project and it worked perfectly fine.
Reply
#4
Hm, then I assume it's something weird in the Unity project. One thing you can always try is to disable the Spline and delete it's CP's continously over a certain amount of frames (e.g. one CP GameObject each frame), much like pooling managers would do it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I want to make the beginning and end of a mesh translucent. yanke 3 4 05-21-2022, 11:53 AM
Last Post: _Aka_
Bug Extrusion and scale curve issues Sacryn 3 6 04-08-2022, 12:30 PM
Last Post: _Aka_
  How do I make the computer ignore it's parent transform? eastes 3 7 04-06-2022, 12:16 PM
Last Post: _Aka_
  how to make the lines disappear little by little ? Zik Dipa 1 5 01-11-2022, 09:26 PM
Last Post: _Aka_

Forum Jump: