当前位置:网站首页>Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
2022-07-05 09:20:00 【CoderZ1010】
目录
一、简介
Avatar Controller适用于第三人称的人物控制,包括相机控制,目前初始版本v0.0.1包含对Avatar三个动画的控制:Idle静止、Walk行走、Sprint奔跑,通过Speed参数控制BlendTree,如图所示:
阈值分别如下:
该工具已经上传至我的开发框架SKFramework中,如图所示:
SKFramework框架开源地址:
https://github.com/136512892/SKFramework
二、使用说明
1.人物控制
为Avatar人物添加Avatar Controller组件,实现人物控制
Avatar移动通过Rigidbody刚体组件驱动,因此需要同时添加刚体组件,假设人物重70公斤,将Mass设为70,Freez Rotation设为true,如图所示:
为Avatar添加Collider碰撞器,并设置适当大小:
为Avatar添加Animator组件,并指定Animator Controller:
2.相机控制
为Camera相机添加Avatar Camera Controller组件,实现相机控制:
三、参数说明
1.Avatar Controller
Main Camera:主相机 用于跟随人物
Sprint Key:加速按键 按下该键时 人物进入奔跑状态
Walk Threshold:行走阈值 与Animator BlendTree中阈值相对应
Sprint Threshold:奔跑阈值 与Animator BlendTree中阈值相对应
Rotate Speed:旋转值使用插值方式 插值的速度
2.Camera Controller
Avatar:Avatar人物
Horizontal Sensitivity:鼠标水平方向灵敏度
Vertical Sensitivity:鼠标垂直方向灵敏度
Rot Y Min Limit:旋转y值的最小值限制
Rot Y Max Limit:旋转y值的最大值限制
Rotation Lerp Time:插值到目标旋转值所需的时间
Height:相机距人物的高度
Min Distance Limit:相机距人物最小距离限制
Max Distance Limit:相机距人物最大距离限制
Scroll Sensitivity:鼠标滚轮滚动的灵敏度
Invert Scroll Direction:是否翻转鼠标滚轮滚动的方向
Obstacle Layer:避障检测时障碍物的Layer层
其中Obstacle Layer用于避障检测,例如在场景中放置一个障碍物,将其Layer层级指定为Default,假设它是障碍层:
将Obstacle Layer也设为Default:
如图所示,当相机与人物之间被障碍物遮挡时,相机会向前拉进越过障碍物:
边栏推荐
- Understanding rotation matrix R from the perspective of base transformation
- C # compare the differences between the two images
- Attention is all you need
- Add discount recharge and discount shadow ticket plug-ins to the resource realization applet
- Codeforces Round #648 (Div. 2) E.Maximum Subsequence Value
- C#图像差异对比:图像相减(指针法、高速)
- Composition of applet code
- Priority queue (heap)
- Kotlin introductory notes (VIII) collection and traversal
- Information and entropy, all you want to know is here
猜你喜欢
Introduction Guide to stereo vision (7): stereo matching
顶会论文看图对比学习(GNN+CL)研究趋势
【阅读笔记】图对比学习 GNN+CL
AUTOSAR从入门到精通100讲(103)-dbc文件的格式以及创建详解
Kotlin introductory notes (II) a brief introduction to kotlin functions
OpenGL - Coordinate Systems
Introduction Guide to stereo vision (3): Zhang calibration method of camera calibration [ultra detailed and worthy of collection]
Rebuild my 3D world [open source] [serialization-1]
什么是防火墙?防火墙基础知识讲解
LeetCode 496. 下一个更大元素 I
随机推荐
Global configuration tabbar
fs. Path module
牛顿迭代法(解非线性方程)
Luo Gu p3177 tree coloring [deeply understand the cycle sequence of knapsack on tree]
OpenGL - Model Loading
2011-11-21 training record personal training (III)
Blue Bridge Cup provincial match simulation question 9 (MST)
Alibaba cloud sends SMS verification code
【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
Node collaboration and publishing
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
优先级队列(堆)
My experience from technology to product manager
Kotlin introductory notes (VII) data class and singleton class
Nips2021 | new SOTA for node classification beyond graphcl, gnn+ comparative learning
Blogger article navigation (classified, real-time update, permanent top)
测试老鸟浅谈unittest和pytest的区别
. Net service governance flow limiting middleware -fireflysoft RateLimit
Applet network data request
C language - input array two-dimensional array a from the keyboard, and put 3 in a × 5. The elements in the third column of the matrix are moved to the left to the 0 column, and the element rows in ea