Howdy.
I understand you’re teaching caching as well as using IF statements. Below is the code I did as my own code challenge before I watched you introduce the caching variables approach. It only needs 4 lines of code without using caching variables and is a simple copy and paste to the Update () and then changing the false values to true.
Once I saw your use of caching variables I refactored my code to use them. I see the value of using caching variables in more complex code blocks.
Jim
void Start()
{
GetComponent<MeshRenderer>().enabled = false;
GetComponent<Rigidbody>().useGravity = false;
}
void Update ()
{
GetComponent<MeshRenderer>().enabled = true;
GetComponent<Rigidbody>().useGravity = true;
}