Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnEndReached event firing twice
#1
Howdy, I have two splines with a connection setup making one of the splines a follow-up. I am seeing the OnEndReached event called more than expected.  I expected this to only be called twice once for the end of the first spline and once for the end of the second follow-up spline. I am currently seeing it called 3 times, twice when the end of the first spline is reached and a third time for the follow-up spline. 

When the end of the first spline is reached the OnEndReached event is called as expected with the correct position and control point values, Immediately afterward the event is called for a second time with the values of the EventArgs set to the follow-up spline and the connected control point.

Any advice on how to resolve or mitigate the issue would be appreciated. 

Unity: 2021.2
Curvy: 7.1.6
Reply
#2
Hi

That event is triggered when an end of the spline, in the broader sense, is reached. That includes both ends, the first and last control points.

In your case, I would add in the event listener a test to check if the event's control point is indeed the last control point of the spline or not.

I think this should do it. If you need further help, please let me know

Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Wink In SplineController OnPositionReachedList Event is missing shimizu 2 14 02-07-2022, 12:47 PM
Last Post: shimizu
  How to send event to generated game object upon ControlPoint deletion? toxicfrog 8 184 12-03-2021, 02:02 PM
Last Post: _Aka_
  Change to Random Spline on End Reached Event ricke 10 982 09-14-2021, 12:31 AM
Last Post: ricke
  Assigning "OnControlPointReached" and "OnEndReached" values during runtime? TenaciousLibbs 2 3,013 02-18-2021, 01:12 PM
Last Post: PretzelStudios

Forum Jump: