2016-08-05 8 views
0

電車を下に押し上げるとジョイスティックが上下に動いてジョイスティックが期待どおりに動かず、逆もあります。画面上のジョイスティックが1つで5

私はそれを逆にしたいと思います。

ここにコード

using UnityEngine; 
using System.Collections; 
using UnityStandardAssets.CrossPlatformInput; 

public class joystick : MonoBehaviour { 
    public float TrainSpeed = 50; 
    public float TrainRotateSpeed = 50; 
    // Use this for initialization 
    void Start() { 

    } 

    // Update is called once per frame 
    void Update() { 
      transform.Translate(0f, 0f, TrainSpeed *   CrossPlatformInputManager.GetAxis("Vertical") * Time.deltaTime); 
     transform.Rotate(0f, TrainRotateSpeed * CrossPlatformInputManager.GetAxis("Horizontal") * Time.deltaTime, 0f); 

} 

}

答えて

0

がTrainSpeed前にマイナスを追加している:

transform.Translate(0f, 0f, -TrainSpeed * CrossPlatformInputManager.GetAxis("Vertical") * Time.deltaTime); 
+0

は私がしようとしますありがとう、私は知っていた - どこかに行かなければなりません –

関連する問題