Game Development Reference
In-Depth Information
5.1 Doors, locks, and keys
In this section we are going to discuss two types of doors: rotating doors and sliding doors.
Rotating doors are just like ordinary doors we usually see: they rotate around y axis and their
rotation axis is on the left or right end of the door. On the other hand, sliding doors usually
move in one dimension (right, left, or up) just like elevator doors.
Let's begin with rotating doors. To implement such doors with ease, we can use a new physics
component called Hinge Joint . This component is specific for object that have limited
freedom of movement, such as doors. To begin, we can create a simple room with floor and
four walls; where one of these walls leads outside through a door opening. In this opening
we locate our door like in Illustration 76. After that, we need to add a rigid body component
to the door and configure it as in Illustration 77. Notice that we increase both drag and
angular drag to make the door movement speed reasonable (otherwise it will feel too light).
Search WWH ::




Custom Search