window->package manager
右键->Cinemachine->2D Carmera
记得勾选 is Trigger
空对象位置记得要和小鸟保持一致,不然等下写完脚本后,镜头一开始会移动一下
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class NewBehaviourScript : MonoBehaviour
{private GameObject player;// Start is called before the first frame updatevoid Start(){player = GameObject.Find("player");}// Update is called once per framevoid Update(){//水平跟随玩家transform.position = new ansform.position.x, transform.position.y, transform.position.z);}
}
把脚本拖拽给多边形触发器
本文发布于:2024-02-01 05:52:13,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170673793334365.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |