Sunday, October 14, 2012

FlyScript for Unity

FlyScript is a ready to use C# script for Unity, it lets the user transform a GameObject into a flyable airplane with just the clic of a button. This package contains among FlyScript, a demostration scene ready to play, with a runway and a free model of a Typhoon european fighter jet also included.

FlyScript generates values for drag and lift with interpolation formulas based on aircraft data. It uses Unity's physics, therefore it requires a RigidBody component.

Dec 9: I'm working on a package update with some new features and a better demo scene, when it is ready I will upload a video demo of the package to the Asset Store. In the meantime there is available a YouTube video here: 






14 comments:

  1. Hi,


    After I added the Settings from the Zip file into the ProjectSettings I still got 4 errors I had to fix myself.

    In the Input add 4 more entries:
    Cam1 = 1
    Cam2 = 2
    Wbrake = w
    LGear = g

    Also at the speed of 500 kmh or higher I could not get the wing

    The wing trail is not working as seen in the video.

    Please fix this and I will give more stars.

    Thanks!

    ReplyDelete
    Replies
    1. Thanks for your feedback, the package will be fixed and updated tomorrow, regarding the wing trails, they are activated when the aircraft speed is greater than 500 km/h and the altitude is higher than 1000 meters (you could change it as you like).

      Delete
  2. I am interested in purchasing this but I need to know a few things. Is there a ground model of sorts such that when the gear is on the ground it follows ground based collisions? In other words, when not flying does it taxi correctly on the ground following the terrain mesh?

    Are the flight dynamics parameters configurable so that you can make the aircraft's behave differently?

    Along the same note can you make it fly less real, less true to life so that it acts more along the lines of an arcade feel but still obeys gravity and some other physics things?

    I don't mind doing some work although for the price tag it would be nice to have it work "out of the box".

    ReplyDelete
    Replies
    1. When the plane is on the ground it follows terrain as it uses wheelcolliders, flight dynamics are configurable but requires code modifications specifically the lift and drag functions, I could aid and provide some help if you need to modify them.
      I think you could modify the rotations code block to achieve a more arcade style but that depends on how you want it to behave, if you have doubts about the package please watch the videos to see how it works out of the box.

      Delete
  3. Code modifications are fine. I am a software developer by trade so coding is expected. One of the things I am looking for is for the flight dynamics to be complete for Unity. "Complete" is a big word I understand that.
    So in terms of the flight dynamics settings how much detail can you give away here so we understand more about it? Do you model wings (ie lengths, cross sectional aspects, Reynolds numbers, etc) and other control surfaces summing the forces to make the full flight physics? Or is it more faking here and there? Faking is fine as long as we can tweak parameters to give different flight feels for different aircraft.

    Another thing is a decent chase plane camera. It appears what you have is smooth and its a little hard to tell but it looks like you have some control over the position behind the aircraft.

    ReplyDelete
  4. EDIT: I wanted to edit the previous post but didn't see that I could

    It might help to know that I will be modeling WWI and WWII propeller aircraft not jets. It shouldn't make a difference I imagine if we have control over thrust.

    One other thing, it sounds like there is a bug in the inputs and the two buyers commented that they had to fix this in order to get it to work. Before I buy I expect that to be fixed including any other instructions that are required for it to work out of the box. It should work out of the box given to requirements stated only a joystick was required.

    ReplyDelete
    Replies
    1. I updated the package and submitted it to Unity, its pending review and should be online in the next hours (1.15 update).
      The flight dynamics is resumed in two functions, the first for drag and the other for lift. The way it calculates both of them is based on interpolation formulas to get roughly the same results of FoilSim 3, I suggest you try FoilSim and see how it works. First calculates drag/lift based on airspeed, this is a quadratic function, double the speed quadruple the lift and drag, then modifies the base value based on the aircraft inclination or angle of attack and finally modifies it again based on air density (altitude of the airplane) After all the calculations, the output lift and drag values are very close to what FoilSim gives. The rotations are handled in a non-physical way based on airspeed. Hope that helps. For futher information I suggest you write an email to unityflyscript(at)gmail.com

      Delete
    2. I updated the package and submitted it to Unity, its pending review and should be online in the next hours (1.15 update).
      The flight dynamics is resumed in two functions, the first for drag and the other for lift. The way it calculates both of them is based on interpolation formulas to get roughly the same results of FoilSim 3, I suggest you try FoilSim and see how it works. First calculates drag/lift based on airspeed, this is a quadratic function, double the speed quadruple the lift and drag, then modifies the base value based on the aircraft inclination or angle of attack and finally modifies it again based on air density (altitude of the airplane) After all the calculations, the output lift and drag values are very close to what FoilSim gives. The rotations are handled in a non-physical way based on airspeed. Hope that helps. For futher information I suggest you write an email to unityflyscript(at)gmail.com

      Delete
  5. Thanks so much! You have been very helpful. I will check out FoilSim 3 and your updated version.

    ReplyDelete
  6. Purchased. I'll give it a whirl and give some feedback.

    ReplyDelete
  7. Hi, I like the package.

    How can this be made compatible with CInput 2?
    As CInput required to override the Input Settings file as well ;/

    Can the HUD be optimized as well?

    Many thanks!

    ReplyDelete
    Replies
    1. Hi, regarding CInput 2 you should check that package documentation, but I can say there is no need to override the input settings file if you take the job to manually add the key codes to the input manager, but since the input settings do not get exported when submittig a package to unity asset store, there was the need to add the zip file containing the input file so to avoid the missing input error. To make it compatible with CInput I guess you can use their input file and then add the FlyScript specific inputs to it.

      Delete