Building interactive VR experiences with C#
So far, we have added interactions to our scene just by using Unity’s Animation system without writing a single line of code. In the next sections, you will learn how you can use scripting with C# to add even more complex breaths of air into your GameObjects and scene.
The first question we are going to answer is this: when do we need to write C# code for our animations and interactions?
Understanding when to use C# for animations and interactions
It’s important to understand that Unity’s animation and animator systems and the use of C# scripting are not mutually exclusive. They are often used together, with the animator controlling predefined animations and C# adding interactivity based on user input or other game events.
In the previous section, we rotated and scaled cars based using Unity’s animation and animator systems. These systems are primarily used to create predefined animations. We can divide...