📜  如何使角色移动统一 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:16.457000             🧑  作者: Mango

代码示例2
float horizontal = Input.GetAxis("Horizontal");
 float vertical = Input.GetAxis("Vertical");
 float speed = 5.0f;
 
 void Update(){
     transform.position = new Vector3(horizontal, 0, vertical) * speed * Time.deltaTime;
 }