[英](Unity3D) error CS1503: Argument 2: cannot convert from 'float' to 'UnityEngine.Space'
I'm trying to learn c# in unity and when I follow an old tutorial on using the mouse to look and move I get this error.我正在尝试统一学习 c#,当我按照有关使用鼠标查看和移动的旧教程进行操作时,出现此错误。 It seems like unity has been greatly updated since then.
从那时起,Unity 似乎有了很大的更新。 I figured I can try and learn the c code anyway.
我想无论如何我都可以尝试学习c代码。 Is there any simple way to make it work?
有什么简单的方法可以让它工作吗? I'm trying to move a ball around in first person view.
我正在尝试以第一人称视角移动球。
using UnityEngine;
public class Motion : MonoBehaviour
{
public float speedx = .1f;
void Update()
{
float movement = Input.GetAxis ("Vertical");
movement *= Time.deltaTime;
this.transform.Translate
(Vector3.forward, movement);
float xDirection = Input.GetAxis("Horizontal");
Vector3 moveDirection = new Vector3(xDirection, 0.1f, movement);
transform.position += moveDirection * speedx;
}
}
(Vector3.forward , motion) 应该是 (Vector3.forward * movement)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.