We've seen the anatomy of a
GameObject as a collection of components and nothing more. This raises logistical issues about how components should interact and communicate with each other. Each component is effectively implemented as a self-contained script file, separate from any other component, yet a component must often interact with others. Specifically, you'll often need to access variables and call functions on other components on the same
GameObject, and you might even need to do this on every frame. This section explores such intercomponent communication.
One way to call functions on other components is to use
BroadcastMessage, as shown in Chapter 1, Unity C# Refresher. These functions are type agnostic. ...