Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualFLeBlanc

Posted 23 May 2013 - 08:17 AM

if (camPos != playerPos) camPos += (playerPos - camPos) * strength;
This seems dodgy to me. What happens if the distance between player and camera is smaller than the length of (playerPos-camPos)*strength? This would happen if strength>1. You don't show how you calculate strength, so I assume it's tied to elapsed time somehow. If strength>1 then the camera will over-shoot the player's position which can possibly cause camera stutter. You might try clamping strength to 1 to keep it from overshooting.

#1FLeBlanc

Posted 23 May 2013 - 08:13 AM

if (camPos != playerPos) camPos += (playerPos - camPos) * strength;
This seems dodgy to me. What happens if the distance between player and camera is larger than the length of (playerPos-camPos)*strength? This would happen if strength>1. You don't show how you calculate strength, so I assume it's tied to elapsed time somehow. If strength>1 then the camera will over-shoot the player's position which can possibly cause camera stutter. You might try clamping strength to 1 to keep it from overshooting.

PARTNERS