项目实训(十一)FPS游戏之手臂资源的导入,实现行走奔跑

文章目录


前言

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);
            }

猜你喜欢

转载自blog.csdn.net/qq_45856546/article/details/125193690
今日推荐