Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: Calling TeleportBy on a controller that is stopped
#1
Hi,

I notice whenever I open my project, or after pressing stop if it's running, I get lots of this error. It runs fine so I am not sure if it's a big deal but it's a bit annoying seeing it fill the console every time I open the project. Like I say no run-time errors at all it's only when I press stop or on loading the project. Is there something obvious I am missing that would stop this from happening? I did search the forum and Google but couldn't find anything.

Full error (latest version of Curvy and Unity):

[Curvy] Calling TeleportBy on a controller that is stopped. Please make the controller play first
UnityEngine.Debug:LogError(Object)
FluffyUnderware.DevTools.DTLog:LogError(Object) (at Assets/Plugins/DevTools/Classes/DTUtility.cs:848)
FluffyUnderware.Curvy.Controllers.CurvyController:TeleportBy(Single, MovementDirection) (at Assets/Plugins/Curvy/Controllers/CurvyController.cs:1042)
FluffyUnderware.Curvy.Examples.TrainCarManager:LateUpdate() (at Assets/Plugins/Curvy Examples/Scripts/TrainCarManager.cs:67)


Thanks
Reply
#2
Hi,
Can you please send me a reproduction case?
Thanks
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(07-11-2020, 01:08 PM)_Aka_ Wrote: Hi,
Can you please send me a reproduction case?
Thanks

Hi, if you load the train-12 example scene, on the train object -> trainmanager script... the issue seems to be if you change the axle size to less than 9, then if you turn the train object or trainmanager on or off it triggers this error (this is just a quick way to reproduce the error I now get on loading the project or stopping it playing) .... it's probably something very specific that doesn't actually matter so don't want to waste your time on it but yeah something to do with the axle size it seems!
Reply
#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. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#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
#6
You are welcome
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  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 8 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_
  Error when trying to connect nodes in prefab edit mode Lupos 4 9 06-02-2023, 10:27 AM
Last Post: _Aka_

Forum Jump: