Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Air controls for 3rd Person

Discussion in 'Scripting' started by Major-Idea, Dec 5, 2012.

  1. Major-Idea

    Major-Idea

    Joined:
    Jul 26, 2012
    Posts:
    12
    Hi, I really could use some help with this.

    I'm using unity's third person controller for my flying character, and I already changed it so when pressing jump, it flies up:

    Code (csharp):
    1. if (Input.GetKey (KeyCode.Space))
    2.     {
    3.         lastJumpButtonTime = Time.time;
    4.     }
    Thing is, when its in the air, I cant control it the say way as if it was on the ground. It just keeps going in the directing and speed with which it left the ground.

    Any Ideas what I need to change in the code? :confused:
     
  2. Major-Idea

    Major-Idea

    Joined:
    Jul 26, 2012
    Posts:
    12
    forgot to add - to make it fly I had to delete/comment lines 237- if (IsGrounded()) { and 245- }
     
  3. Hackmysack

    Hackmysack

    Joined:
    Dec 6, 2012
    Posts:
    1