Constraints
Previously in the Hangman on a rope recipe, we've looked at ropes and how they can bend and move with the object(s) they are bound to. In this recipe, we will look at constraints, which are a much cheaper hinge that can be used on two objects. Specifically, we will hang a primitive pyramid object from a solid and allow it to swing on all axes.
Getting ready
Open
My_Level.cry
within the SandboxPlace down a 1x1x1 meter solid and suspend it in the air roughly four meters off the ground
Place down a BasicEntity and change the model to
objects/default/primitive_pyramid.cgf
Set the mass of the BasicEntity to
100
How to do it...
Begin by placing down a constraint:
In the RollupBar, click on the Entities button.
Under the Physics section, select Constraint.
Place the constraint on the bottom surface of the solid box.
Move the pyramid underneath the solid box and have the tip intersect with the radius of the constraint.
The next time the player jumps into the game and pushes the pyramid, it will...