Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ability to set speed in distance over time?

I've been developing my project and Curvy has been incredibly helpful in doing so.  I'm trying to add some additional functionality.  
I'm looking for the ability to define how long it will take (in seconds) a Spline Controller GameObject to move between two pre-defined points of the spline at runtime.

So let's say I have another script in which I've already defined the specific segment of the spline by assigning two GameObject variables, which are two control points on the Curvy spline.  I want the script to tell the Spline Controller how long it should take to move between these two distances in actual, exact, real-world seconds of time.  Here's what I'm talking about in pseudocode, so you get the idea:

GameObject segmentStart = CP0003 (GameObject path point on a spline with CurvySplineSegment component)
GameObject segmentEnd = CP0006 (another GameObject path point on the same spline with CurvySplineSegment component)
float segmentDuration = 12.5f;

At runtime, I want my script to be able to tell the SplineController that it should take a total of "segmentDuration" seconds to travel between "segmentStart" and "segmentEnd".  

I would then likely define the next segment (say, CP0006 thru CP0008) and assign it a different float value for "segmentDuration", and do this several times for several different segments over the course of the spline.

I've tried a few different things but to no avail.  Any ideas?

Thanks very much!

Either utilize the Animate feature (Speed is the delta while Duration is the time) or calculate the speed manually using distance and time.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Conform function, but applied to different directions at the same time Hartigan27 1 8 02-19-2022, 05:09 PM
Last Post: _Aka_
  Using scripting to generate meshes over time croner1907 5 20 02-11-2022, 10:17 PM
Last Post: _Aka_
  Change Speed on spline linkinballzpokemon 1 16 12-29-2021, 10:58 AM
Last Post: _Aka_
  Absolute distance along spline for Shape Extrusion Module amutp 3 264 10-31-2021, 10:26 AM
Last Post: _Aka_

Forum Jump: