默默向上游unity:⼈物移动代码(通⽤式)常⽤的移动代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Yd : MonoBehaviour
{
public float speed;
// Use this for initialization
void Start()
{
speed = 5f;你们一定要幸福
上将军衔
}
// Update is called once per frame
祥林嫂原文void Update()
辞退公务员{
float vertical = Input.GetAxis("Vertical");
凉拌素什锦float horizontal = Input.GetAxis("Horizontal");
transform.Translate(new Vector3(horizontal, 0, vertical) * Time.deltaTime * speed);
}
}
对您有帮助的话, 求给个三连吧!
发布评论