Unity中让摄像机自动跟随主角进行移动

首先在Unity场景中主摄像机上绑定一个脚本,在这里我绑定的是CameraFollow.cs的一个脚本,然后打开脚本,并复制以下的代码:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraFollow : MonoBehaviour {

	private Transform target;
	private 

猜你喜欢

转载自blog.csdn.net/jianjianshini/article/details/105083796