Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Objects Spawning in Runtime
#5
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


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. Heart
Reply


Messages In This Thread
Objects Spawning in Runtime - by Kuxii - 03-22-2020, 05:49 PM
RE: Objects Spawning in Runtime - by _Aka_ - 03-23-2020, 01:56 PM
RE: Objects Spawning in Runtime - by _Aka_ - 03-24-2020, 01:50 PM
RE: Objects Spawning in Runtime - by _Aka_ - 03-24-2020, 05:45 PM
RE: Objects Spawning in Runtime - by Kuxii - 03-24-2020, 11:23 PM
RE: Objects Spawning in Runtime - by _Aka_ - 03-25-2020, 03:06 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_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
Wink Modifying Splines at Runtime artsung 1 7 01-30-2024, 09:40 AM
Last Post: _Aka_
  Is it possible to create a road texture at runtime? artsung 1 4 01-30-2024, 09:30 AM
Last Post: _Aka_

Forum Jump: