Unity摄像机跟随Target快速位移和旋转
来源:互联网 发布:网络存储空间 编辑:程序博客网 时间:2024/06/06 14:24
版权声明:本文为博主原创文章,未经博主允许不得转载。
- public Transform target;
- public float distance ;
- public float targetHeight;
- public float PitchAngle;
- private float x = 0.0f;
- private float y = 0.0f;
- void Start () {
- var angles = transform.eulerAngles;
- x = angles.x;
- y = angles.y;
- }
- void LateUpdate ()
- {
- if(!target)
- return;
- y = target.eulerAngles.y;
- // ROTATE CAMERA:
- Quaternion rotation = Quaternion.Euler(x-PitchAngle, y, 0);
- transform.rotation = rotation;
- // POSITION CAMERA:
- Vector3 position = target.position - (rotation * Vector3.forward * distance + new Vector3(0,-targetHeight,0));
- transform.position = position;
- }
0 0
- Unity摄像机跟随Target快速位移和旋转
- Unity摄像机跟随Target快速位移和旋转
- Unity摄像机跟随Target快速位移和旋转
- Unity摄像机旋转和位移跟随
- Unity摄像机旋转和位移跟随
- Unity 摄像机平滑跟随
- Unity摄像机跟随Player
- unity 控制摄像机旋转和缩放
- unity GearVr 摄像机移动和旋转问题
- Unity--简单的摄像机跟随和地面的坐标获取
- unity摄像机跟随的脚本
- Unity摄像机跟随角色移动
- Unity)摄像机Camera跟随
- unity 摄像机跟随物体 第一人称跟随
- unity旋转 缩放摄像机
- unity基础开发----物体位移和旋转实用代码
- 【Unity快速实现小功能】实现摄像机跟随角色移动功能
- Unity脚本,平滑跟随目标物体移动和旋转
- SDUT 数据结构实验之排序三:bucket sort (无语题)
- c语言
- HTML5 FileReader base64图片预览
- 自定义类加载器
- vector入参map出参范式
- Unity摄像机跟随Target快速位移和旋转
- 让apache 不区分大小写
- Unity摄像机旋转和位移跟随
- 触摸屏基础知识
- javaWeb学习笔记----1 HTML
- android之旅7 ListView与ArrayAdapter、SimpleAdapter
- Unity 3D--摄像机平滑跟随(方法一)
- C#中变量的使用以及命名方法
- JavaScript执行顺序详解