拖入人物模型
在unity创建场景,建一个平面并把人物模型拖上去
加入跑步动画和移动代码
把跑步的动画加在人物模型上并挂上代码
为物体添加移动代码:本次使用的方式A、W、S、D键控制前后左右运动
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class yodong : MonoBehaviour
{
private Animator anim;
void Start()
{
anim = GetComponent<Animator>();
}
//定义一个速度
void Update()
{
if (Input.GetKey(KeyCode