放主摄像机上,直接上代码.
using UnityEngine;
using System.Collections;
public class FlowPlayerMove : MonoBehaviour {
public Vector3 juli=new Vector3(0f,2.5f,-2f);
private GameObject player;
public float smoothing=6;
// Use this for initialization
void Start () {
player=GameObject.FindGameObjectWithTag ("Player");
}
// Update is called once per frame
void Update () {
Vector3 pos = player.transform.position + juli;
transform.position= Vector3.Lerp (transform.position,pos,smoothing*Time.deltaTime);
}
}