Good news I Got it Working, Have used ah Other Spline, Have Ah smal Spleep in my Code addet
and now See.
http://prntscr.com/rm6yn6
Big Thanks For your Help.
and now See.
http://prntscr.com/rm6yn6
Code:
IEnumerator SetPos(CurvySpline spline, float a1, float a2, float a3, int direction)
{
yield return new WaitForSeconds(.5f);
try
{
for (int u = 0; u < this.motor.Length; u++)
{
try
{
this.motor[u].Spline = Track;
this.motor[u].Play();
}
catch(Exception ex)
{
log.Error("Set Spline: " + ex);
}
if (direction == 0)
{
this.motor[u].MovementDirection = FluffyUnderware.Curvy.Controllers.MovementDirection.Forward;
}
else
{
this.motor[u].MovementDirection = FluffyUnderware.Curvy.Controllers.MovementDirection.Backward;
}
}
}
catch(Exception ex)
{
log.Error("Can not Set the Train Correct: " + ex);
}
yield return new WaitForSeconds(.5f);
try
{
for (int u = 0; u < this.motor.Length; u++)
{
if (u == 0)
{
this.motor[0].Position = a1;
}
else if (u == 1)
{
this.motor[0].Position = a1;
this.motor[1].Position = a3;
}
else if (u == 2)
{
this.motor[0].Position = a1;
this.motor[1].Position = a2;
this.motor[2].Position = a3;
}
}
}
catch(Exception ex)
{
log.Error("Can not Set the Train Pos: " + ex);
}
}
}
Big Thanks For your Help.