Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create an arrow dynamically following the spline
#17
(10-05-2017, 08:54 PM)Roger Cabo Wrote: I think that have to do with Initializing the complete spline system at start.
Are you sure the splines are fully initialized when you use it?

Code:
 IEnumerator Start() {
          foreach (var Spline in FindObjectsOfType(typeof(CurvySpline)) as CurvySpline[]) {
              while (!Spline.IsInitialized) {
                  yield return null;
              }
          }
      }

You can check this, if you wait a second, then calling your function.
public int frames;
Code:
void Update(){
  frames++;
  if (frames > 100)  run your function to create the arrow.

}

only an idea.


Thank you for the idea. I've check if the spline is initialized with a simple 
Code:
Debug.Log ("spline -> " + launcherSpline.IsInitialized);
And it returns always true. You made me doubt about if there is some problem with the initialization. I dont do an initalization at code, I create the curvy spline on the inspector with 3 Control Points, and it used to interpolate between them to make a smooth curve. But its no longer the case so with only the 3 Control Points, on sometimes it add a fourth one on the fly to interpolite a tiny bit but not enough to make a smooth curve. So I think is an interpolation problem, dont know if I have to do something else to make that interpolation works as a smooth curve. Is there any method to "initialize forcing the spline to have X positions based on just 3 Control Points?
Reply


Messages In This Thread
RE: Create an arrow dynamically following the spline - by yandrako - 10-06-2017, 09:33 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to duplicate a spline with an offset Kapistijn 8 1,301 04-12-2026, 03:18 PM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 647 11-13-2025, 11:32 AM
Last Post: _Aka_
  Create Game Object Renaming Options rickgplus 1 925 09-23-2025, 09:33 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,435 07-29-2025, 09:15 PM
Last Post: _Aka_

Forum Jump: