Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Addlistener on OnEndReach in code is not working
#1
I have the following

Code:
dc = GetComponent<DebtCollector>();
       if (dc != null)
       {


           if (sc != null && !sc.Spline.Closed)
           {

               sc.OnEndReached.AddListener(e => {
                   if (dc != null)
                       dc.Collect();
               });
               sc.OnEndReached.CheckForListeners();


           }
       }

But the function is never called.
Any idea what is causing this?

I also tried by passing a member function but non is working.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Import/Export, Spline from code Mos Def 1 219 01-27-2021, 08:47 PM
Last Post: _Aka_
  Updating old movement code Maltakreuz 3 1,215 08-18-2020, 04:49 PM
Last Post: _Aka_
  Creting SplineControllers thru code generating errors curvyuser007 7 2,229 06-07-2020, 04:19 PM
Last Post: curvyuser007
  Refresh spline doesn't seem to be working dazz777 6 3,350 01-22-2020, 12:55 AM
Last Post: _Aka_

Forum Jump: