Search Unity

enemy spaceships keep falling

Discussion in 'Scripting' started by Notneo, Apr 5, 2010.

  1. Notneo

    Notneo

    Joined:
    Apr 5, 2010
    Posts:
    20
    I'm working on a 3d space shoot'em up game and the enemies keep falling. I'm using code similar the the FPS tutorial AI code, I think something in there is causing them to fall. Any help would be appreciated.
     
  2. Merries

    Merries

    Joined:
    Feb 2, 2009
    Posts:
    262
    Check to see if there is any gravity settings.
     
  3. Notneo

    Notneo

    Joined:
    Apr 5, 2010
    Posts:
    20
    as far as I can see we turned off anything with gravity, do you mean in script of an object, if it's script I can't see anything that has to do with gravity.
     
  4. Xsnip3rX

    Xsnip3rX

    Joined:
    Aug 29, 2009
    Posts:
    197
    Go to Edit> Project Settings > Physics, check where it says Gravity: X, Y, Z, etc and make them all 0
     
  5. Notneo

    Notneo

    Joined:
    Apr 5, 2010
    Posts:
    20
    Xsnip3rX thanks for the help, the lab is currently closed so can't try it yet, but if it dose work I'm nominating your for the next president.
     
  6. Ramen Sama

    Ramen Sama

    Joined:
    Mar 28, 2009
    Posts:
    561
    What are you using to control the enemies? Rigid body, character controller? or just some simple code? if it's a character controller, it will apply gravity thru that script.
     
  7. Notneo

    Notneo

    Joined:
    Apr 5, 2010
    Posts:
    20
    yeah its a character controller, do you know how to turn that off
     
  8. Ramen Sama

    Ramen Sama

    Joined:
    Mar 28, 2009
    Posts:
    561
    Well, i believe there's a variable called gravity in the script.
     
  9. Notneo

    Notneo

    Joined:
    Apr 5, 2010
    Posts:
    20
    I checked everywhere there is not a gravity in the code
     
  10. GamersHeaven

    GamersHeaven

    Joined:
    Feb 15, 2010
    Posts:
    88
    if it have an rigid body check so that its set to kinematic.