Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnControlPointReached not triggering when metadata attached
#1
Hello there,

In my game i make use of OnControlPointReached.AddListenerOnce().
The problem i run into is, that every once in a while (maybe 1 out of 200 runs) the Listener will not fire for control points where there is a Metadata script attached to it.
It works fine most of the time, and i have no clue what could cause it not to fire in these rare occasions.
Any ideas? The code looks something like this:


       protected override void Start(){
           if(Application.isPlaying){
               OnControlPointReached
.AddListenerOnce(OnCPReached);

           base.Start();
       }

   
       public void OnCPReached(CurvySplineMoveEventArgs e)
       {
           if(Application.isPlaying){
               Debug.Log(e.ControlPoint.ToString());

               var metadata = e.ControlPoint.GetMetadata<FinishMetadata>();              
               if(metadata!=null){
                   Debug.Log("has metadata attached");
               }
           }
       }

So on a good run the Console output will look something like:
Spline.CP0002
Spline.CP0003
Spline.CP0004
Spline.CP0005
has metadata attached
Spline.CP0006

on a bad run:
Spline.CP0002
Spline.CP0003
Spline.CP0004
Spline.CP0006

CP0005 is just missing and not "listening" at all ....
Reply


Messages In This Thread
OnControlPointReached not triggering when metadata attached - by cyclo - 05-22-2019, 10:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  "MetaData" Of Entire Spline Heightmap SAMYTHEBIGJUICY 3 6 10-16-2023, 08:42 AM
Last Post: _Aka_
  Metadata interpolation tairoark 3 10 10-17-2022, 01:07 PM
Last Post: _Aka_
  Proper metadata usage tairoark 2 8 10-01-2022, 12:04 PM
Last Post: _Aka_
  Accessing Metadata from CG hucota7 1 8 02-16-2022, 08:49 PM
Last Post: _Aka_

Forum Jump: