Skip to main content
New Participant
January 19, 2021

First VR App tutorial errors

Hey guys, I started the build your first VR app tutorial here from oculus, but I keep getting NullReferenceException errors from the ColorController.cs file. Here is where I get the errors:
// Assigns the component's renderer instance
        rend = GetComponent<Renderer>();
        rend.enabled = true;
        displayText.text = "";

// Checks if the player ball has collided with the wall.
        if (col.gameObject.name == "player-ball")
        {
            displayText.text = "Ouch!";
            rend.sharedMaterial = wallMaterial[0];
        }

// It is called when the ball moves away from the wall
    private void OnCollisionExit(Collision col)
    {
        if (col.gameObject.name == "player-ball")
        {
            rend.sharedMaterial = wallMaterial[1];
            displayText.text = "Keep Rolling...";
        }
    }

I am not able to see the text change whenever the ball is rolling, or when it hits the wall. The app runs fine other than that. Please let me know if you guys have any solutions/tips. Thank you. 
This topic has been closed for replies.

3 replies

New Participant
January 26, 2021
What is "Display Text" set to? It should be "message (Text)" if all the steps were followed.
New Participant
May 12, 2022

I believe I followed all the steps, however "Display Text" is set to "None (Text)" and no other options are available.  Any idea why this is? 

New Participant
September 9, 2022

Hey! Im running into the same issue, did you end up finding out how to solve it?