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
  Controler Speed from metadata Bryan Thatcher 4 8 06-25-2024, 11:18 AM
Last Post: _Aka_
  Getting Distance from a World Point zorksox 3 5 04-16-2024, 07:30 PM
Last Post: _Aka_
Question Volume Spots inter group distance Sacryn 1 3 02-27-2024, 04:08 PM
Last Post: _Aka_
  Distance travelled across multiple splines jh092 1 8 02-23-2024, 09:44 AM
Last Post: _Aka_

Forum Jump: