Blog

Unity3D Parachute – Cloth, Joints and Physics

November 2, 2010 by Devin Reimer

When I first received the Unity 3.0 Beta one of the first things I played around with was the new cloth physics. What better way to learn something than to make a tech demo. After some thought I decided on creating a parachute.

One thing I quickly discovered about the new cloth physics within Unity was that it is very heavy (requiring a lot of computing power). That means for the most part cloth physics are slow. So before you go off and try to create a game with lots of physics based cloths you have been warned, it will probably end up being too slow. While cloth does have its uses, they are a little more limited than I had hoped.

My original plan for this demo was to build a parachute using only cloth physics. I ended up having to tweak this a bit for performance reasons. Since in real life a parachute moving downward is fairly rigid so I instead opted to only swap in a physics based cloth once the parachute’s payload touches the ground. The rest of the time I would use a normal mesh renderer. This way I can get the parachute to collapse nicely over the payload but only use the physics aspect for a short period of time.

The parachute’s movement is completely driven by the physic system. A configurable joint is used to attach the Rigidbody of the parachute to the payload (in this case a crate). A physics force is then applied to the parachute based on the maximum amount of lift that parachute is capable of. This way if you increase the mass of the payload the parachute will fall faster and on the flip side a payload of less mass will fall slower.

I ended up leaving the Interactive Cloth’s options pretty much unchanged as changing some of them ended up impacting performance too much. The parachute’s cable are dynamically generated using LineRenderers.

This example is built is such a way that you should easily be able to attach whatever you would like as the parachute’s payload.

To check out the demo click here.

To get the source (unitypackage) click here.

Source Requirements: Unity 3.0

Thanks again to Calin for creating the models.

9 Responses to "Unity3D Parachute – Cloth, Joints and Physics"

  1. Windgate says:

    How can you make a Joint with a Cloth and other object?

    I though joined objects need both a rigidbody.

    • Devin Reimer says:

      In this example the cloth is never attached with a joint. The Interactive Cloth is only enabled once the crate hits the ground that the joint is removed. That being said it would be possible for it to have a cloth as long as it is within a GameObject that has a Rigidbody.

  2. mipago says:

    excellent work congratulations and thanks for sharing your knowledge

  3. taekyoung says:

    thsnks for sharing your knowledge

  4. NamCao says:

    Thank you so much! ^_^

  5. zeeshan ali says:

    Hey dear friend I’m using unity 2017.2 and Some of your scripts showing errors like in Parachute logic script, it’s giving error for the InteractiveCloths. I’m a beginner in unity so sorry if I’m asking a question without meaning but seriously i didn’t understand that one of the error was blender not found But I understand the blender and now I’m stuck.

  6. Suntir says:

    Hello, I’m doing a similar demo recently. The ‘interactivecloth’ class in your unitypackage is missing. Can you send me a copy! Thank you very much.

Leave a response