Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Follow Up Spline Issue
#1
Hi,

I am using the Curvy Spline plugin to create a racing style game. I have created 3 scenes, and each scene has 1 spline for the path. I then load in each scene to create the full race track. Is it possible to connect all of the splines together across all 3 loaded scenes, so that when my car drives through "scene 1" and it approaches the end of the spline, it will get the spline on "scene 2" and continue driving until scene 3 etc.?

At the moment my code kinda looks like this, to set it up:

Code:
for (int i = 0; i < m_raceTracks.Count; i++)
{
   CurvySpline currentTrack = m_raceTracks[i].GetComponent<CurvySpline>();
   if (currentTrack != null && i > 0)
   {
       ChunkSpline previousTrack = m_raceTracks[i - 1].GetComponent<ChunkSpline>();
       if (previousTrack != null)
       {
           previousTrack.LastVisibleControlPoint.SetFollowUp(currentTrack.FirstVisibleControlPoint);
       }
   }
}

So I set the 'Follow Up' of the previous spline's last control point (which is a connection) to the next spline's first control point (which is also a connection).

On each of the splines, let's say they all have 5 control points to easily explain:

On Spline 1 - the starting spline, I have only CP0005 set as a Connection point, the "Head to" dropdown box is empty, and I cannot select anything here. CP0005 has the "Head To Spline Start" checkbox Ticked.

On Spline 2 - the middle spline, I have CP0000 and CP0005 set as Connection points, the "Head to" dropdown box is empty, and I cannot select anything here. CP0000 has the "Head To Spline End" ticked and CP0005 has "Head To Spline Start" ticked.

On Spline 3 - the end spline, I have only CP0000 as a Connection point, the "Head to" dropdown box is empty, and I cannot select anything here. CP0000 has the "Head To Spline End" ticked.


On my car, I have the Spline Controller script attached to it, the position mode is set to Relative and start position is 0. The 'Connections Handling' is set to Follow Up Spline and Allow Direction Change = true.


Does all of this seem okay? I could find anywhere for documentation or code examples for how to set up Follow Up on the splines.

Any help would be greatly appreciated,

Thanks!
Reply


Messages In This Thread
Follow Up Spline Issue - by JHulse95 - 07-24-2019, 11:30 AM
RE: Follow Up Spline Issue - by _Aka_ - 07-24-2019, 05:42 PM
RE: Follow Up Spline Issue - by _Aka_ - 07-24-2019, 06:20 PM
RE: Follow Up Spline Issue - by JHulse95 - 07-25-2019, 10:59 AM
RE: Follow Up Spline Issue - by _Aka_ - 07-25-2019, 01:04 PM
RE: Follow Up Spline Issue - by JHulse95 - 07-25-2019, 01:44 PM
RE: Follow Up Spline Issue - by _Aka_ - 07-25-2019, 02:08 PM
RE: Follow Up Spline Issue - by JHulse95 - 07-25-2019, 02:34 PM
RE: Follow Up Spline Issue - by _Aka_ - 07-25-2019, 02:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Additional offset to Follow behaviour Ayyappa 3 7 Yesterday, 01:35 PM
Last Post: _Aka_
  Rasterized Path Range issue proton 7 23 Yesterday, 11:17 AM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_

Forum Jump: