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
  best way to rotate, change offset, and inset position of splinecontroller object smackledorf 1 4 01-17-2022, 01:39 PM
Last Post: _Aka_
  Bend mesh along spline quickytools 1 2 01-11-2022, 09:14 PM
Last Post: _Aka_
Question How to tell if a spline is straight? / Optimize problems with straight splines MarioBag 3 9 12-27-2021, 05:25 PM
Last Post: _Aka_
Wink Moving object along spline close to player minaa 7 11 12-27-2021, 02:39 PM
Last Post: _Aka_

Forum Jump: