Forum Discussion
lowlevelangel
3 years agoHonored Guest
Build Your First Vr App
Hey everyone! 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 or colours 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.
1 Reply
Replies have been turned off for this discussion
- luaryenHonored Guest
click first-wall, in inspector, set wall material list, [0] = after-collision, [1] = wall-color, repeat this step for 2nd-4th wall
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 months ago
- 2 months ago
- 1 year ago