07-13-2020, 12:28 PM
(07-11-2020, 08:54 PM)_Aka_ Wrote: I replaced the implementation of LateUpdate with this to avoid the issue:
I haven't tested it thoroughly. Will do before the next release.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;
}
}
}
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