[英]Rigidbody.Addforce in"oncollisionenter" is not executing in unity c#
[英]Unity C# - Rigidbody.AddForce not working as intended
因此,我試圖使用WSAD按鈕使多維數據集移動,由於某種原因,即使我沒有觸摸任何按鈕,它也會沿對角線向上和向左移動。 我正在使用Unity 4.5.1
碼:
using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
public float moveSpeed;
private Vector3 input;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
input = new Vector3(Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical"));
print(input);
}
}
您的問題可能在其他地方,因為代碼看起來還不錯。 如果我是你,我將嘗試瀏覽此頁面 。 您可能會找到解決此問題的方法
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.