Summary
In this chapter, we explored the basic concepts that you will use while creating scripts. We discussed the concept of a script’s assets and how the C# ones must inherit from MonoBehaviour
to be accepted by Unity to create our own scripts. We also saw how to mix events and instructions to add behavior to an object and how to use fields in instructions to customize what they do. All of this was done using both C# and visual scripting.
We just explored the basics of scripting to ensure that everyone is on the same page. However, from now on, we will assume that you have basic coding experience in some programming language, and you know how to use structures such as if
, for
, array
, and so on. If not, you can still read through this book and try to complement the areas you don’t understand with a C# introduction book, as you need.
In the next chapter, we are going to start seeing how we can use what we have learned to create movement and spawning scripts.
...