Search Unity

Vector 3 and Get Axis improvements

Discussion in 'Documentation' started by Michael_93, Jul 1, 2014.

  1. Michael_93

    Michael_93

    Joined:
    Jan 12, 2014
    Posts:
    95
    I would recommend that the Vector 3 would say it's in local space. I would also recommend in the manual saying that when you release a key the number resets back to 0 unless the gravity is 0.
    I spent a lot of time thinking I had a bug in my movement when really all I needed to do was set the gravity in the Input manager to 0 for the Horizontal axis. I would still be stuck if it wasn't for the useful forums and tutorials.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    The Input page does actually mention how the gravity value works but admittedly, the description is very short; a fuller description is probably in order here.

    As regards the Vector3 issue, I'm not really sure what you are getting at when you say it is in "local space". Is there any particular function or section of text where the distinction between local and world space is unclear?
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Vector3 is not in local space...or rather it can be, if you say so. It's just 3 floats, which can mean anything. Local, world, direction to the nearest pizza joint with my front door as the origin, whatever.

    --Eric
     
  4. Michael_93

    Michael_93

    Joined:
    Jan 12, 2014
    Posts:
    95
    Ah my bad with the vector 3 thing. I think I'm trying to say something but I can't explain it properly. Just I originally thought if I said Vector3.forward it would move in one direction no matter what and would not be effected by the rotation.
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Vector3.forward is just shorthand for Vector3 (0.0, 0.0, 1.0). What you do with those numbers is entirely up to you.

    --Eric
     
  6. Michael_93

    Michael_93

    Joined:
    Jan 12, 2014
    Posts:
    95
    I know just nevermind