1

I am totally a beginner in Unity (Downloaded Unity 3 days ago). I created a simple game and I can move the player with keyboard by using this code -

void FixedUpdate () {
            float speed = 250;
    float moveHorizontal = Input.GetAxis ("Horizontal");
    float moveVertical = Input.GetAxis ("Vertical");

    Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
    GetComponent<Rigidbody>().AddForce (movement * speed * Time.deltaTime);
}

However, I want to play the game in Android and for that I need to use joystick. Can anyone tell me how to use the joystick in Standard Assets?

FadedCoder
  • 1,517
  • 1
  • 16
  • 36

2 Answers2

2

Me has helped this Asset. There's also a video tutorial on implementation.

user2413972
  • 1,355
  • 2
  • 9
  • 25
-1

Remove Time.deltaTime, Time.deltaTime is for Update() not for FixedUpdate()...