private Transform player;
public float speed = 2;
public float up = 3.04f, away = 4.55f;
void Start()
{
player = GameObject.FindWithTag("Player").transform;
}
// Update is called once per frame
void Update()
{
if (player!=null)
{
Vector3 targetpos = player.position + Vector3.up * up - player.forward * away;
transform.position = Vector3.Lerp(transform.position,targetpos,speed * Time.deltaTime);
transform.LookAt(player);
}
}
Unity摄像机跟随
最新推荐文章于 2024-06-17 20:46:24 发布
1667

被折叠的 条评论
为什么被折叠?



