Hello,
I make a platformer game. the camera follows the player in the X axis with a little offset of 7 units. I made a script to change this offset accordingly to the direction the player is moving. How can I smooth the transition between the two positions of the camera??
Circle = camera
Polygon = Player
#pragma strict
var player : Transform;
var reverse : boolean;
function Update () {
if(!reverse)
{
transform.position.x = player.position.x + 7;
}
else
{
transform.position.x = player.position.x -7;
}
}