Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug with listener
#1
Hi,

I found a weird bug : 

If I enable the SplineController and then use SplineController.OnControlPointReached.AddListenerOnce(), the listener doesn't work. 
But if I do the opposite (add the listener then enable), if my initialPosition is set to 0 (so on a ControlPoint), the SplineController is stuck on "return eventAwareMoveDistance(ref tf, ref direction, distance, clamping,false);". So it doesn't move...
Reply
#2
Hi,
I will investigate this bug once I am back from vacation, next week. If easily fixable, the bug fix will be in the next release, otherwise it will be included in an upcoming release.
Can you please give me the curvy and unity versions you use?
Also, in the future, please use the in-editor Curvy bug reporter, or this link https://curvyeditor.com/bugreport since those chanels will include data that helps me fix the bugs.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Unity 2017 2.1p3
Curvy 2.2.2
Reply
#4
Hi,

I found the cause behind your issue, and have a workaround for you:

The cause:
when you enable the SplineController via code, Unity calls the SplineController 's Start() method the next frame, which reinitializes the controller, cancelling your call to Play() the previous frame.

The workaround:
  • Without modifying Curvy: Do not call controller.enable = true and controller.Play() in the same frame
  • While modifying Curvy: Here are some code modifications that will avoid you the issue, but keep in mind that this is just a quick fix, which means that it wasn't thought about thoroughly (to find all the side effects) and not tested at length.
          In SplineController.cs, replace OnEnable's implementation with this:      
Code:
               protected override void OnEnable()
               {
                   base.OnEnable();
                   BindEvents();

                   if (IsConfigured && DependenciesInitialized)
                       Prepare();
               }
               In the same class, replace Prepare() with this      
Code:
               public override void Prepare()
               {
                   if (mIsPrepared)
                       return;

                   BindEvents();
                   base.Prepare();
                   mKeepDistanceAt = 0;
               }


The proper fix:
The real fix to this will not be in the next update. Right now, and for the first time since I acquired Curvy in January, I am doing fundamental refactoring to fix a whole class of bugs (instead of hunting individual bugs, which are just the symptoms of the root issues) and to improve performance in a major way. Such work takes time. The next update will have such work done on the Splines code, since it is the most fundamental code in the package. Once this work is done, I will start doing fundamental refactoring on controllers, including SplineController.

Please let me know if neither one of the workarounds worked with you.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
(04-04-2018, 01:08 PM)_Aka_ Wrote: Once this work is done, I will start doing fundamental refactoring on controllers, including SplineController.
Hi,
So I have been working on controllers in the last weeks. I fixed the issue I described in my previous post. After fixing it, I found that indeed there is also a listener related bug, which I fixed too.
Both fixes will be available in the next update.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Forum Jump: