为提高Player能力
需明确4个内容
1.Player inputs and controls 玩家输入和控制
2.Field of View(FOV) 视场
3.Timelines and branching logic 时间线和分支逻辑
4.Adding sounds and particle effects to an object interaction 在对象交互中添加声音和粒子效果
一. Adding the running functionality 添加运动功能
1,Breaking down the character movement 分解角色移动
打开FirstPersonCharacter
StickInput 摇杆输入
进行Yaw和Pitch的输入
解释
pitch:俯仰,将物体绕X轴旋转(localRotationX)
例如 飞机上下转动
yaw:航向,将物体绕Y轴旋转(localRotationY)
例如 飞机左右转动
roll:横滚,将物体绕Z轴旋转(localRotationZ)
例如 飞机以机体为轴旋转
或者在蓝图StickInput中断开某一连接,然后晃动摇杆就能得到更直接的感受
其中Base Rate是2个变量用来调节晃动速率,尽管每一帧都会调用触发器,但得乘WorldDeltaSeconds,用来针对不同的帧速率进行归一化
然后3者相乘传递给控制器输入来与玩家相机上的效果之间添加转换
MouseInput 鼠标输入
与StickInput大同小异,不做过多赘述,如对MouseInput不懂,欢迎私聊
MovementInput 移动输入
select 节点部分
判断是否使用VR HMD
如果使用,则矢量为第一人称摄像机
没用,则是Actor根组件
+1运动方向为为前进和向右
JumpInput 跳跃
2,Customizing control inputs 自定义控制输入
Edit->Project Setting->input
创建Sprint和Zoom2个输入
解释:
Action Mappings与Axis Mappings
动作映射用于按键的按下和释放
轴映射允许连续范围的输入。一般用于移动和一定范围的事件
3,Adding a Sprint ability
二.Animating a zoomed view
FOV指玩家的视野大小
1,Using a timeline to smooth transitions 使用时间轴平滑过渡
起点 0,90 终点 0.3 ,45
三,Increasing the projectile's speed
打开FirstPersonProjectile
四,Adding sound and particle effects
1,Changing target states with branches
判断是否击中,击中则变红,并且Primed设为真
2.Triggering sound effects,explosions,and destruction
击中后,再射击,则爆炸消失