Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: Calling TeleportBy on a controller that is stopped
#5
(07-11-2020, 08:54 PM)_Aka_ Wrote: 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

Hi thanks for this, seems to have fixed it and still works fine Smile
Reply


Messages In This Thread
RE: Error: Calling TeleportBy on a controller that is stopped - by jamesunity - 07-13-2020, 12:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Set Volume to the Volume Controller at Runtime pako88 2 10 04-08-2024, 03:26 PM
Last Post: _Aka_
  Add noise to spline controller movement DekoGames 2 10 02-06-2024, 01:28 PM
Last Post: DekoGames
  Controller behavior like E21_VolumeControllerInput ashuraVlad 3 11 06-22-2023, 09:26 AM
Last Post: _Aka_
  how to make fast moving controller go all the way to linear points?(curvy8) hawken 7 12 06-06-2023, 09:47 AM
Last Post: _Aka_

Forum Jump: