Using events and instructions
Now that we have a script, we are ready to do something with it. We won’t implement anything useful in this chapter, but we will settle the base concepts to add interesting behavior to the scripts we are going to create in the next chapters.
In this section, we are going to cover the following concepts:
- Events and instructions in C#
- Events and instructions in Visual Scripting
- Using fields in instructions
- Common beginner C# script errors
We are going to explore the Unity event system, which will allow us to respond to different situations by executing instructions. These instructions will also be affected by the value of the editor. Finally, we are going to discuss common scripting errors and how to solve them. Let’s start by introducing the concept of Unity events in C#.
Events and instructions in C#
Unity allows us to create behavior in a cause-effect fashion, which is usually called an...