Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: Calling TeleportBy on a controller that is stopped
#4
I replaced the implementation of LateUpdate with this to avoid the issue:
Code:
void LateUpdate()
        {
            if (!mTrain)
                return;

            if (BackAxis.Spline == FrontAxis.Spline &&
                FrontAxis.RelativePosition > BackAxis.RelativePosition)
            {
                float carPosition = Waggon.AbsolutePosition;
                float frontAxisPosition = FrontAxis.AbsolutePosition;
                float backAxisPosition = BackAxis.AbsolutePosition;

                if (Mathf.Abs(Mathf.Abs(frontAxisPosition - backAxisPosition) - mTrain.AxisDistance) >= mTrain.Limit)
                {
                    FrontAxis.AbsolutePosition = carPosition + mTrain.AxisDistance / 2;
                    BackAxis.AbsolutePosition = carPosition - mTrain.AxisDistance / 2;
                }
            }
        }
I haven't tested it thoroughly. Will do before the next release.

Let me know if you have any question related to this.
Have a nice day
Please consider leaving a review for Curvy Splines, this helps immensely. Thank you.
Reply


Messages In This Thread
RE: Error: Calling TeleportBy on a controller that is stopped - by _Aka_ - 07-11-2020, 08:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't set CG Path Controller j95677 4 3,717 10-04-2024, 06:55 PM
Last Post: j95677
  How to use CG Volume Controller j95677 5 4,157 07-17-2024, 07:15 PM
Last Post: j95677
  playmaker integration error DNeville 5 3,798 05-23-2024, 07:01 AM
Last Post: _Aka_
  Set Volume to the Volume Controller at Runtime pako88 2 2,471 04-08-2024, 03:26 PM
Last Post: _Aka_

Forum Jump: