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
  Force spline normal to be always world up GameJazz 12 18 58 minutes ago
Last Post: _Aka_
  Gap between spline mesh segments Beaver_Boy 8 15 08-06-2022, 12:11 PM
Last Post: _Aka_
  How to stop spline refreshing when a control point is deleted or removed? Beaver_Boy 4 6 07-23-2022, 11:24 AM
Last Post: _Aka_
  How to get Split Length to match spline segment length? dromo 4 12 07-21-2022, 10:04 PM
Last Post: _Aka_

Forum Jump: