So... I have a cube I am making into a cardboard box, and i have 2 flaps on the sides.

Well, how would I get the flaps to bounce around/move when the object hits the ground?

EDIT: would I have to use different objects and parent them, or could I keep it as one object?


You can achieve this using Rigid Body Physics and Rigid Body Constraints to form a hinge between the box and each of the flaps.

Create the box and flaps as separate objects and enable 'Active' Rigid Body Physics to each. For more realistic physics you should also set the Mass on each of the objects appropriately (in the Physics tab in the Tool panel (T) select 'Calculate Mass' and then select Cardboard).

closed cardboard box

Create Empties to act as the hinges. It's a good idea to use the 'Single Arrow' form of empty as the 'hinge' will act around the Z axis of the empty and the single arrow points along the Z axis (so the arrow will lay along the length of the hinge). Position the empties pointing along the edge between the flap and box where you require the hinge.

empty hinges

Parent each of the flaps and each of the empties to the box. This way, when you move the box around in the scene the hinges and flaps will follow.

Select each hinge empty in turn and in the Physics properties window enable Rigid Body Constraint. Set the Type to 'Hinge', Object 1 to the box, Object 2 to the flap, enable Z Angle limits and set the Lower and Upper limits appropriate to that flap (the angle it's allowed to bend from its initial 'at rest' position. Since the flap is already in the 'closed' position, one of the limits should be 0 degrees to prevent the flap from closing inside the box. The other limit should be a suitable angle to prevent the flap bending too far outside the box (I chose +/-250 degrees (so limits -250,0 for one and 0,250 for the other) so that it would stop at 20 degrees off the side of the box).

rigid body constraint

Running the rigid body simulation should now produce something like this :

animated cardboard box

| improve this answer | |

There are multiple ways: you can rig it with bones, deform it with shapekeys (although that won't behave as expected when trying to rotate the flaps), or use separate objects and either parent them (for animating) or use object constraints (for physics).

The "best" way (least problematic) would be to rig a simple armature, but using separate objects might be easier.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.