Game Development Reference
In-Depth Information
Figure 13.11 Public variable being
defined via drag and drop.
Hallway-Baked (there are actually two versions of the Hallway if you're
using the imported package, one that's unlit for use with a flashlight
(next chapter) and one that is baked. For now we'll use the baked
version since it will just be easier to see).
Why?
This tells the script which object to rotate when the trigger is tripped. This
can be the only way to work if there are many objects that have the same
name; if we were using the GameObject.Find method, Unity could get
very confused. With this method, Unity knows exactly which object to be
working with and doesn't have to use cycles when it starts going out and
finding GameObjects.
Step 12: Make sure that the door is not set to Static. Select Hallway_Door_
Bulkhead_Group and in the Inspector, be sure the Static button is not
checked ( Figure 13.12 ). Be sure this is also the case for the children.
Figure 13.12 Ensuring the door
is not Static. Static objects won't
animate.
Search WWH ::




Custom Search