Game Development Reference
In-Depth Information
Illustration 38: The scene we are going to use to illustrate triggers and usable objects
In the scene you see in Illustration 38, we have a first person character that is going to re-
present the player. Additionally, we have (from left to right): a point light with an object
above it to represent an electrical light, a standing control panel to control the fan on the
wall, and an electrical switch on the wall to turn the light on or off. The usable objects in
this scene are the fan and the light, and we are going to be able to use them through the
triggers (the switch and the control panel).
Solet's beginwiththetriggerthatcanbeusedbytheplayertouseobjects. Listing 35 shows
SwitchableTrigger script. I used the term s witchable , since there are other types of non-
switchable triggers, such as time triggers and hit triggers that activate automatically when
the player touches them.
Search WWH ::




Custom Search