I'm making a horizontal scrolling shooter. I need a camera that will follow the player smoothly and stop a few units away from the edges of the screen. What I call the "dead zone". When the player enters the "dead zone" the camera stops following in that direction and the player can continue a short distance to the edge of the screen. These dead zones are independent on the x and y.
For example, the player reaches the dead zone on the -X or left side of the screen. The camera stops moving in the -X direction but can continue to move in Y.
I've been able to set this up and it works how I want. The only problem I have is the camera isn't smooth when it's following the player. I'm using a Vector3 Lerp on the Camera to chase the Player. A Get Vector3 to isolate the X and Y positions. Finally a Set Position using X and Y.
All of this is in one FSM State running at Every Frame.
How can I get a smooth follow without having to use the smooth follow action?