Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Control of an object that uses a spline
#3
After some more testing, it appears to operate as suspected... basically, I need to execute my code sometime after the current frame I disable the spline controller.  

So this doesn't work:

Code:
    private void PathEndReached(CurvySplineMoveEventArgs arg0)
    {
        _controller.enabled = false;
        transform.position = new Vector3(960, 1080);
    }

But this does work:

Code:
    private void PathEndReached(CurvySplineMoveEventArgs arg0)
    {
        _controller.enabled = false;
        StartCoroutine("MoveToTop");
    }

    IEnumerator MoveToTop()
    {
        yield return new WaitForSeconds(0.1f);
        transform.position = new Vector3(960, 1080);
    }

That makes sense to me.  If there's a better way to do the above, please let me know.  Thanks again for your help.
Reply


Messages In This Thread
RE: Control of an object that uses a spline - by ricke - 09-15-2021, 12:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems with spline prefab topquarkone 3 81 09-15-2021, 08:47 PM
Last Post: _Aka_
  Change to Random Spline on End Reached Event ricke 10 191 09-14-2021, 12:31 AM
Last Post: ricke
  Split existing segment(s) with additional control points KStress71 1 73 09-09-2021, 05:46 PM
Last Post: _Aka_
  Spline Controller Flickering blabz2007 6 217 09-03-2021, 09:29 AM
Last Post: _Aka_

Forum Jump: