前言
FPS游戏之手臂资源的导入,实现行走奔跑
获得资源
在unity 自带的官方商店中搜取该资源
找到后下载
拖入unity的文件夹后,取消他的预制体
然后再里面挂上已经做好的FP Mouselook FPCharacterControllerMovement 脚本实现角色移动等
制作动画
在FPCharacterControllerMovement 设置动画的移动,实现行走奔跑
if (characterAnimator != null)
{
characterAnimator.SetFloat("Velocity",
CurrentSpeed * movementDirection.normalized.magnitude,
0.25f,
Time.deltaTime);
tp_CharacterAnimator.SetFloat("Velocity",
CurrentSpeed * movementDirection.normalized.magnitude,
0.25f,
Time.deltaTime);
tp_CharacterAnimator.SetFloat("Movement_X", tmp_Horizontal, 0.25f, Time.deltaTime);
tp_CharacterAnimator.SetFloat("Movement_Y", tmp_Vertical, 0.25f, Time.deltaTime);
}