Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spline Controller Flickering
#7
(09-02-2021, 11:03 PM)blabz2007 Wrote: But the real problem is Spline.Length isn't 30 - you can see that on line 45 - Debug.LogWarning.
That's normal: all your CPs have 0 coordinates on x and y. So the only relevant coordinate is Z. Your first CP has a Z of 0. Also your setup gives for each CP a Z coordinate bigger than its previous one. So under all those circumstances, the length of your spline is the Z coordinate of your last CP, which is 30 - Z coordinate of the previous CP.

Here is a variation of your code that does maintain the length of the spline to 30

Code:
int rnd = Random.Range(1, 5);
        float lastUsedZ = 0;
        for (int i = 1; i < rnd; i++)
        {
            lastUsedZ = lastUsedZ + i * 4.0f;
            Spline.Add(new Vector3(0, 0, lastUsedZ));
        }

        // Create last Control point
        Spline.Add(new Vector3(0, 0, lastUsedZ + 30 - Spline.Length));

If your spline has always the same length, then the problem I explained in my previous post is no more.
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
Spline Controller Flickering - by blabz2007 - 08-27-2021, 11:38 PM
RE: Spline Controller Flickering - by _Aka_ - 08-28-2021, 08:55 AM
RE: Spline Controller Flickering - by blabz2007 - 08-31-2021, 12:15 AM
RE: Spline Controller Flickering - by blabz2007 - 08-31-2021, 07:31 PM
RE: Spline Controller Flickering - by _Aka_ - 08-31-2021, 08:56 PM
RE: Spline Controller Flickering - by blabz2007 - 09-02-2021, 11:03 PM
RE: Spline Controller Flickering - by _Aka_ - 09-03-2021, 09:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  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_

Forum Jump: