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
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 3 Yesterday, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 13 03-04-2024, 11:06 AM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
  Keeping a fixed spline length jh092 3 16 02-21-2024, 06:25 AM
Last Post: Primrose44

Forum Jump: