- Home /
Smoother lerp at fast speeds?
I'm making a fzero like game, The player controls a vehicle that goes around a windy cylinder at very high speeds. I have the vehicle snapping to the tube mesh whenever you go around it BUT I am getting very jerky camera and vehicle movements each time there is a new segment of the track mesh. Because I am raycasting down and aligning with the mesh below it. I HAVE to have it lerp to the mesh very quickly otherwise the vehicle easily goes flying off the track. But its so quick it jerks constantly. Is there some way I can get a smoother lerp at high speeds, or get my vehicle to follow the mesh path but not instantly snap to its normal while going really fast? It needs to align fast but not jerk.
EDIT: The vehicle moves so fast I don't think lerp is ever going to work right. The only other thing I can think of is making the camera a child of the vehicle again BUT is there some way to make it a joint like a ragdoll or something where it doesn't snap to the car instantly I need it to be a somewhat loose child.
Here is a example of the game. https://dl.dropboxusercontent.com/u/94084288/ProjectZero/ProjectZero.html
Are you using a rigidbody or more specifically anything using the FixedUpdate
loop?
You can make Lerp go faster or slower with code like this one
float t = .0f;
float rate = 1.0f / time;
while ( t < 1.0f ) {
t += Time.deltaTime * rate;
number = $$anonymous$$athf.Lerp( float1, float2, t );
// Stuff
}
The sound of your game is annoying x(
Your answer
Follow this Question
Related Questions
Player falling faster 0 Answers
interpolate a move variable 0 Answers
animation length, changing speeds quandary 0 Answers