Game Development Reference
In-Depth Information
Figure 7-4. The Fixed Joint component in the Inspector
The Connected Body property holds the reference to the game object the sphere is connected
to with the Fixed Joint. If left empty, the joint is connected to the game world. The Fixed Joint has
physical characteristics, including the possibility that it could break. Break Force and Break Torque
tell the physics engine the amount of force or torque required to break the joint. The default values of
Infinity instruct the physics engine that the joint is unbreakable.
Now create a Cube game object with a Transform position of (6.5, 24, 60) and rename it Link01. Add
a Rigidbody component. In the Hierarchy, select the Pendulum Sphere. Drag the Link01 game object
from the Hierarchy and drop it into the Fixed Joint component Connected Body field in the Inspector,
or use the circle selection button to the right of the field, then select Link01. Now the Pendulum
Sphere and Link01 game objects are connected by a Fixed Joint.
Hinge Joint
The Hinge Joint is just what you would expect by the name: a joint connecting two game objects that
allows movement around a single axis, just like the hinge on a door. Select the Link01 game object in
the Hierarchy, then select Add Component ➤ Physics ➤ Hinge Joint in the Inspector (Figure 7-5 ).
Figure 7-5. Hinge Joint component in the Inspector
 
Search WWH ::




Custom Search