Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Curvy Offset with Lerp
#1
Hello Smile

I have a little situation when I want to do a custom transition between 2 offset with curvy.


My goal is:

I have somes keys on a road, with a SplineController static on the keys, with different offset radius & angle.
Then I have a player, with a SplineController who follow the road. I want to lerp the offSet radius/angle of the player depending on the key before and after.

So Every frame, I'm doing my calculation, and here the result:


Basicly, I do:
Code:
_splineController.OffsetRadius = Mathf.Lerp(prevRadius, nextRadius, percent);
_splineController.OffsetAngle = Mathf.Lerp(prevAngle, nextAngle, percent);

prevRadius & prevAngle: the value of the previous gost Spline Controller (white car)
same with next for the next gost

The problem is durring the lerp, the car is going up and down in a circle, and it is logic from my code and yours...
But how can I do an offset lerp without this weird behavior ?

Thanks Smile
Reply


Messages In This Thread
Curvy Offset with Lerp - by UsernameHed - 05-09-2019, 02:51 PM
RE: Curvy Offset with Lerp - by _Aka_ - 05-09-2019, 09:21 PM
RE: Curvy Offset with Lerp - by UsernameHed - 05-10-2019, 07:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  8.8.0 is live, and it improves Curvy Generator greatly _Aka_ 1 10 04-03-2024, 03:16 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
Exclamation Extending Curvy Generator for Advanced Lofting - Feasibility Check amutp 2 4 03-27-2024, 07:25 AM
Last Post: amutp

Forum Jump: