最简单的跟随.
将摄像机挂载到主角人物上即可.
FollowTarget脚本
- 在Unity AssetStore 搜索 Standard, 该资源为免费资源;
- 下载并导入
- Standard Assets/Unity/FollowTarget脚本添加到摄像机
- 将主角主物拖到FollowTarget脚本组件中的Target属性.
SmoothFollow脚本
- 在Unity AssetStore 搜索 Standard, 该资源为免费资源;
- 下载并导入
- Standard Assets/Unity/SmoothFollow脚本添加到摄像机
- 将主角主物拖到SmoothFollow脚本组件中的Target属性.
Cinemachine 组件(2D推荐)
- 在Unity AssetStore 搜索 Cinemachine, 该资源为免费资源;
- 下载并导入
- 这时工具栏会出现Cinemachine选项, 如下图:

- 选择图中Create 2D Camera 选项.
属性介绍

本文介绍了三种在Unity2D中实现镜头跟随主角的方法:1) 使用FollowTarget脚本;2) 应用SmoothFollow脚本;3) 利用Cinemachine组件创建2D相机,并详细解释了Cinemachine的相关属性设置。
最低0.47元/天 解锁文章
9469

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



