How do I smooth 3D first person camera scroll?

0 favourites
  • 3 posts
From the Asset Store
Basketball 3D
$7.50 USD
50% off
Template for a basketball game with a 3D aspect (illusion of 3D)
  • Hey everyone. This might be something simple I am missing or forgetting here but it's driving me a bit nuts trying to figure it out.

    I have a driving demo - first person view.

    3D cam is set to be at the angle of the car object.

    I want it to be less jittery and have it scroll more smoothly.

    I created another object to stick to the car and have it set angle to cars angle every 0.1 seconds, then lerp the 3D camera as in lerp(car.angle,car2.angle,0.2) for example.

    This works OK! But when the car's angle goes from 0 hitting the left key to 360 the lerp rotates the camera all the way from 0 -> 360 causing a spin effect.

    Same as if it is at angle 355 and then turning right to get to angle 2 for example, it spins all the way instead of a brief movement.

    Can't figure out the smooth 3D FPS cam scroll without this glitch, anyone know the fix? Camera only needs to move left and right for the angle.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Use anglelerp(a, b, x)

  • Perfect thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)