I want to do a simple parachute simulation. Basically the load has to be at the bottom and the parachute on top. So if the object is instantiated in some odd potition, it should swing back to have the load at the bottom and the parachute on top.
I’ve put a rigidbody and collider on the load hoping it would make it rotate towards there. I’ve also added a rigidoby collider on the parachute and reduced the mass… it didn’t do the trick.
Any ideas to make it fast and simple? I don’t want a full-blown parachute physics with air flowing and stuff, just a simple: load at bottom, parachute on top.
You can use a fixed joint connected to connect the four corners of the parachute to the thing that is falling, which you would give a very high drag. Then you could attach a cloth to the four corners to be the parachute.
I don’t know if you can do the drag thing the other way around, like give the cloth or the corners a high drag (I don’t know if the fixed joints can act in 2 different ways)
You could also just replace the parachute with a custom mesh, and replace the corner pieces with a custom mesh.
I’ve should had mentioned that this is for mobile. Cloth and joints simulations are too expensive for it.
You can’t just set 2 rigidbodies and 2 different weights for it? I do that but they don’t rotate correctly when falling. I don’t want the strings connecting the parachute to the load to blend, so 4 straight “sticks” are fine with me as long as the load lands first.
Per gave you the solution. Freeze rotation on the rigidbody and control the rotation via script. Similar to the banking of a hovercraft in games such as wipeout, linking the rotation to the input would give you a nice visual effect.
Mass has no effect on how quickly something drops.
Add some value to Drag in the Rigidbody of the parachute. Gravity will make both objects drop, but the Drag will make the parachute drop more slowly causing the load to swing down. A parachute works by creating aerodynamic drag, so it should look pretty reasonable with the right values.
Wouldn’t a simple solution be to just reduce the gravity on the rigidbody when the parachute opens? Sure a parachute works by creating aerodynamic drag, but the effect we visually perceive is just a dramatically slower falling speed, no?
A parachute does create drag, which is basically how it works, but drag in this case is basically a force pushing against gravity. If the parachute has a constant force which represents its ability to offset gravity it should fall slower than the object attached to it (the payload). A larger parachute would have a larger constant force and fall more slowly with a payload of the same weight, a smaller parachute would be assigned a smaller constant force and would fall more quickly with a payload of the same weight.
My honest recommendation is to fake it all via scripts instead of physics, because it would be less taxing on the system.
sorry, i just didn’t know where to put it since it can be script, mobile or who-knows-what
we can add some references to THE wedding if that helps
Anyway, at the end I did it all from script. The 2 rigidbody solution with different drags seems the best option but for some reason my 2 gameobjects went separate ways instead of staying connected. I believe you have to set them on a tree structure in certain way for them to interact together but I didn’t want to put much effort into figuring it out.
My script is a simple:
getRigidbody().MoveRotation(Quaternion.LookRotation(Vector3.forward));
At start. You can Lerp that quaternion if you want it to move slowly to that rotation.
Then every so often I simulate a gust of wind rotating the parachute on the Y axis:
getRigidbody().AddTorque(Vector3.up * (randomTorque * Time.deltaTime), ForceMode.Force);
I guess I can add some swinging but I haven’t thought about how to. Maybe rotation on the z axis? I just don’t want to use cos/sin since that’s math intensive on the mobile.
actually my code won’t work since I rotate the look at towards the Vector3.forward which might be in any direction. It will set the object vertically but the load (in this case a person) will be looking towards the Vector3.forward which at the point of jumping might be on his back.
It doesn’t seem realistic.
Solution:
it was very simple i just didn’t think enough:
getRigidbody().MoveRotation(Quaternion.Euler(0, getTransform().eulerAngles.y, 0));
This is actually easier than it looks. You just need to use the rigidbody’s AddForceAtPosition function to apply an upward force to the object, but at the position of the parachute canopy (presumably you have the centre of mass on the load?)
If you want to be really accurate, you should make the parachuteDrag value proportional to the speed of falling, but that isn’t necessary to get the orientation effect.