Missing Component Exception

Hey guys I am getting the following error :

MissingComponentException: There is no ‘MeshRenderer’ attached to the “Tutorial Transitional ramp” game object, but a script is trying to access it.

However, I do have a MeshRender attached to the gameObject. The script is working as well. However, I still get this error. Script below.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class turn_off_renderer : MonoBehaviour {

// Use this for initialization

public MeshRenderer campmeshrend;

void Start()
    campmeshrend = gameObject.GetComponent<MeshRenderer>();
    campmeshrend.enabled = false;

// Update is called once per frame
void Update () {


i think u attach the script to another object in your game too ;

u can use :


to check the object ;