Hi! im really new to scripting and coding and just starting to learn so please be kind to me i tried to look other similar questions here but it didnt help, so here is my question:
Im trying to make camera move smoothly from left to right (in 2D side scroller) when player turns.
i have camera following an empty gameobject in front of the player model and i have this script in that empty gameobject:
function Update () {
if(Input.GetAxis("Horizontal") > 0)
transform.localPosition = Vector3(4,0,0);
else if(Input.GetAxis("Horizontal") < 0)
transform.position = Vector3(-4,0,0);
}
But the problem is how i get it to move smoothly between those points?