Can anyone tell me how to enlarge the minimap by pressing m creating a gentle effect as lerp function? I have done this but the effect is abrupt and orrible.could you tell me how I could use the lerp function with this code or something that will give the same effect?
using UnityEngine;
using System.Collections;
public class MinimapExpand : MonoBehaviour {
public Camera cam;
void Update ()
{
if(Input.GetKeyDown(KeyCode.M))
{
if(cam.rect.x == 0.76f)
{
cam.rect = new Rect (0f, -0.6f, 1.0019f, 1.61f);
}
else if(cam.rect.x == 0f)
{
cam.rect = new Rect(0.76f, 0.73f, 0.22f, 0.24f);
}
}
}
}