With the Ballista dummy in the L1 Force category of the Physics Toolbox, you are able to create a jack-in-the-box. By adjusting the Mass value, the entire structure can become more jittery or stable.
The structure of the Jack-in-the-box is simple. Simply apply a box and a prop and the structure is complete.
After the ball is controlled by the Ballista dummy, you may pick the box as the target of the ball, which eliminates the collision between the box and the ball.
- Apply the Ballista from the L1 Force category of the Physics Toolbox library.
By default, the ballista dummy moves along the Local X axis.
- Double click on the blank space of the Control to open the Advanced Panel.
- Pick the ball as the target object via the advanced panel.
- Change the springing direction to the Z axis in order to get the ball to pop upward.
- Close the advanced panel and click the Shoot button to have the ball pop up. Please note that the ball and the box have no connection to each other. The force created by the popping does not convey to the box.
- Select the ball and open the Constraint Settings panel (Shortcut: Shift + F10). The ball is applied with a Spring constraint.
- Pick the box as the target by pressing the Pick Target button and clicking on the box.
- The collision effect is eliminated because of the deactivation of the Collision Constrained Object feature.
- Click the Shoot button on the control. The box will pop up along with the ball because of the strength of the spring movement of the ball.
The box bounces up with the ball because the spring effect is too strong. In order to keep the structure placed on the ground with slightly hopping behavior, you need to adjust the mass of the box.
The Ballista dummy does not need to be shown; however if you delete it, the control panel will be removed as well. In order to keep the control panel while having the dummy disappear in the scene, you need to follow these steps to hide it.