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

flight simulator

Discussion in 'General Discussion' started by dannyh532, Oct 16, 2014.

  1. dannyh532

    dannyh532

    Joined:
    Aug 25, 2014
    Posts:
    11
    Hello everyone.

    I work on a flight simulator, and I didn't find something to write in the flying (physics) script.

    Help will be appreciated, Danny.
     
  2. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Try the unityfs package on the Asset store.
     
  3. dannyh532

    dannyh532

    Joined:
    Aug 25, 2014
    Posts:
    11
    I'm trying to do it without special addons. Can you help me with that?
     
  4. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    If your trying to do correct flight dynamics and model correct model behavior your best bet is one of the two assets available on the site that do this already for you.
    You are not going to acheive this with a few simple scripts, these assets are going to take all the hard work out of it, why reinvent the wheel.

    I use UnityFS myself and is a lifesaver in getting correct model behavior from the get go.
    It is worth 10 times the price it's been sold for in the time it will take to get anything close to it yourself.

    Best of luck, but I doubt you'll find someone that will do the work for you.
     
  5. Deleted User

    Deleted User

    Guest

    Try->

    from unity asset store Free package: sample asset 4.6 : 3 axis controller.A Flight Simulation.
    example...they did the work for you.I am using it right now..me and all npc's are flying with it.




    My work in Progress

    p-
     
    Last edited by a moderator: Oct 17, 2014
  6. randomperson42

    randomperson42

    Joined:
    Jun 29, 2013
    Posts:
    974
    Try this:
    Code (CSharp):
    1.  
    2. void MakeAirplaneFly()
    3. {
    4.     fly;
    5. }
    6.  
     
  7. hamyshank

    hamyshank

    Joined:
    Jan 31, 2013
    Posts:
    88
    I would like to fork this to add:

    Code (CSharp):
    1.  
    2. void MakeAirplaneAutoFly()
    3. {
    4.     fly;
    5. }
    6.  
     
    SunnyChow and randomperson42 like this.
  8. dannyh532

    dannyh532

    Joined:
    Aug 25, 2014
    Posts:
    11
    Where can I download this package?
     
  9. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    By following instructions..in the first reply to your post. Or do you want someone to do that for you too?
     
  10. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Since we all have to start somewhere, I'll give the benefit of the doubt.
    The package above is a free one that will give you very basic arcade type control, not really usefull for a real sim mind you.
    But can be found here.
    https://www.assetstore.unity3d.com/en/#!/content/8394

    If it's real sim you wish to acheive you will need something more along the lines of these.
    https://www.assetstore.unity3d.com/en/#!/content/11321
    Or
    https://www.assetstore.unity3d.com/en/#!/content/9409
    Or even
    https://www.assetstore.unity3d.com/en/#!/content/15674

    Again all above will get you up and running, but none will be a one click does it all solution.
    You are still going to have to put in a lot of work to get something that stands out from the rest.

    Good luck with your project though. Hope this gets you started.
     
  11. Deleted User

    Deleted User

    Guest

    I chose that solution, because A).it was free..B). I purchased one of the solutions above..and was not very happy with the sheer bulk of the code base ..Code Execution speed, versus realistic flight physics,those were my decision factors.. can it handle 20 aircraft flying around at he same time?? On Android?? Can I easily extend it?

    This can...It all depends on your title..
     
  12. dannyh532

    dannyh532

    Joined:
    Aug 25, 2014
    Posts:
    11
    Hello, I'm sorry I couldn't answer.

    About UnityFS, is there a Boeing 737?

    if not, can I change the physics script or read it?
     
  13. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
  14. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,687
    basically:
    - split up aircraft and wings in several parts
    - you need to calculate area and other geometrical things like mean aerodynamic cord, center of lift etc. of each part
    - you need airfoil data for each part (NACA or custom generated with an airfoil tool)
    - for each part calculate its current speed and angle of attack relative to the air (which is different from the overall aircraft and usually different for each part except in perfect leveled straight flight without any wind)
    - calculate the different drags for each part (way more complicated than it sounds because you have to take the whole wing and its shape and type of tip into account)
    - calculate lift for each part
    - lift and drag of each part affects main rigidbody dependent on its distance and position to the center of gravity
    - you need to calculate the effect of ailerons flaps etc. which basically change the camber of the airfoil when used.

    This is really a total simple overview. It is much more complicated. You need to read read read and reread a lot of papers about aerodynamics.
    I did that twice - in 2008 I failed but in 2011 I finally nailed it and had success. UnityFS is more elegant than my own flight dynamics model but UnityFS offers a little less aerodynamic features. I still want (and I think need) to implement more into my own solution if I ever continue working on it. Correct downwash, wind shadows of parts, flow field for example. All this stuff isn't really implemented in any solution for Unity that I know.

    Anyway if you do that and you visualize forces it would look like in my video at 1:30

     
    John-G likes this.