There is no renderer attached to the game object

I’m getting this error when trying the instantiate a prefab that has the mesh render in the child object.

ie. I imported a Blender model which created the fbx importer. I created a prefab and dropped the fbx importer into it.

The prefab draws ok on it’s own if I drag it onto the scene but the error occurs (and other strange behaviour) when I try to instnatiate it.

Create a prefab and assign it and ensure to apply the changes + save scene so the prefab changes really take place

if you instantiate only a mesh you have to provide the full game object with all components too, a prefab takes care of that for you

I created a mesh renderer for the prefab and it fixed the problem

I met same problem too.
I attached a “mesh renderer” to the “prefab”. but, I couldn’t fix.
how did you do another?

I had xxxxing mistake
I attached non-related gameobject…
I resolved.

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

public class ObjectColor : MonoBehaviour
public Color changedColor = Color.white;
public Color originalColor = Color.white;

void Awake()
	originalColor = this.GetComponent<Renderer>().material.color;

void Update ()
	if (Input.GetKeyDown (KeyCode.G)) {
		this.GetComponent<Renderer>().material.color = changedColor;
		else if (Input.GetKeyUp (KeyCode.G)) 
		this.GetComponent<Renderer>().material.color = originalColor;