How do I make lerp parameter a little smoother? (drone following player)

0 favourites
  • 3 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • I have a drone that follows around my character. Horizontally, it looks nice and smooth, and the animations don't look jumpy. However, when I move vertically, the drone's animations look a little rough. Not enough to be a huge deal, but enough to notice. Here is the code I'm using to make it follow my player character. Am I maybe missing something that would work here?

    I'm looking for a way to make it stop a little farther from my character when I stop too, instead of moving into the middle of the character model. Let me know if there's a way to do this. Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's probably those ±15 pixels.

    I suggest you use MoveTo behavior for the drone instead of lerp. On every tick move to the position behind/above the character. Set small values for acceleration and deceleration for a nice smooth flight.

    And by the way, when using lerp you need to use delta-time. Instead of 0.005 in the last parameter, it should be 0.3*dt. Otherwise the game will run differently on different frame rates.

  • And by the way, when using lerp you need to use delta-time. Instead of 0.005 in the last parameter, it should be 0.3*dt. Otherwise the game will run differently on different frame rates.

    I'd go directly with the mathematically correct way of

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