using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFlow : MonoBehaviour
{
//目标物体
public GameObject target;
//相机与目标物体的距离
public float distance;
//横向角度
public float rotDegree = 0;
public float rotSpeed = 0.2f;
float rot; //弧度
//纵向角度
public float rollDegree = 30;
public float rollSpeed = 0.2f;
public float minRollDegree = 0;
public float maxRollDegree = 70;
float roll; //弧度
//摄像机移动速度(滚轮控制)
public float zoomSpeed = 1.5f;
public float minDis = 8;
public float maxDis = 22;
// Use this for initialization
void Start()
{
//target = GameObject.Find("tank");
//GetTarget(target);
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButton(1))
{
Rotate();
Roll();
}
Zoom();
//角度转换成弧度
rot &
u3d 相机跟随角色行走
最新推荐文章于 2023-09-03 14:53:02 发布
本文详细介绍了在Unity3D中如何设置和调整相机,使其能够完美地跟随角色进行平滑的行走动画,包括相机的距离、角度和限制等关键参数的设定方法。
摘要由CSDN通过智能技术生成