Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by Skuzzbag · Aug 11, 2017 at 07:32 AM · instantiateprefabrenderer

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.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Waz · Jun 26, 2011 at 11:16 PM 0
Share

Show us your code. Almost certainly you are using renderer on the wrong object.

5 Replies

· Add your reply
  • Sort: 
avatar image
-1

Answer by Blinksdope1 · Aug 11, 2017 at 06:49 AM

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;
     }
 }

}

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Dreamora · Jun 27, 2011 at 12:41 AM

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

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Waz · Jun 27, 2011 at 02:24 AM 0
Share

Saving the scene will make no difference to the execution of the game.

avatar image
0

Answer by Skuzzbag · Jun 27, 2011 at 05:56 AM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by shinriyo_twitter · Aug 12, 2011 at 09:22 AM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by shinriyo_twitter · Aug 12, 2011 at 10:32 AM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Instantiate prefab with its component c# 0 Answers

Create gameobject in other scene... 0 Answers

Im having an issue when Instantiate Prefab with specific rotation 2 Answers

Place prefab with mouse on to a grid based surface with a correct orientation. c# 0 Answers

Can't Instantiate an object as child of another 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges