Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change Speed on spline
#1
Hi,
I want to know how I can change the speed of on object following a spline path.

For example, My character is driving on a mountain, so when the player is moving uphill, I want to go slower. And when the player is moving downward, I want to move faster, and this happens multiple times throughout the level. 

I'm not using a controller, and due to other movement code I can't use one for the current project. 
So is there a way I can use easing/animation curves or something to change speeds between control points? 

let me know, thanks Smile

PS: I'm using transform.position = RopeSpline.Interpolate(tf); for movement. But Open to using any other methods
Reply
#2
Hi

Use RopeSpline.InterpolateByDistance(yourDistance), while using the formula of distance = speed * time to define the value of yourDistance

I hope this helped
If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Racing AI around Spline Spectra 0 0 14 minutes ago
Last Post: Spectra
  Root Motion on Spline puddingchomeur 1 3 01-26-2022, 10:12 AM
Last Post: _Aka_
  Spline controller orientation itsGama 4 15 01-24-2022, 06:38 PM
Last Post: _Aka_
  best way to rotate, change offset, and inset position of splinecontroller object smackledorf 1 4 01-17-2022, 01:39 PM
Last Post: _Aka_

Forum Jump: