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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Extrude mesh along spline. New and confused user GhostStalker 3 7 01-02-2025, 09:58 AM
Last Post: _Aka_
  Newly created spline is invisible quickytools 7 19 12-21-2024, 10:14 AM
Last Post: _Aka_
  Method of scattering objects along spline joebain 1 3 11-26-2024, 03:20 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_

Forum Jump: