Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
2 captures
11 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 /
avatar image
0
Question by james.jeffers · Jan 12, 2010 at 02:14 AM · instantiateprefabrendering

Why do instantiated game objects not always render?

When I instantiate a prefab, I've noticed that some parts of that object do not render. When the same prefab is dragged onto the "Hierarchy" tab, the object (and any associated rendering components) render as expected. Why is this?

I instantiate the prefabs like this:

GameObject waypoint = Instantiate(
            Resources.Load("Waypoint"),
            location,
            Quaternion.identity) as GameObject;

In this case, "Waypoint" is the name of the prefab.

Thanks in advance!

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Jaap Kreijkamp · Jan 12, 2010 at 02:24 AM

Is this in the editor or in a build? If it's in a build then possibly the asset hasn't be included into the build as there's no visible link to it. A way to force resources to be included in a build is adding a gameobject with a simple script that has all these resources attached (script with public Transform array and in inspector add all Prefabs to it).

If it's in the editor then there's something else bothering you, guess it's debugging time. Add a Debug.Break() after the statement and look if you see anything weird in Hierarchy, Scene and Inspector about the created object.

Comment
Add comment · Show 2 · 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 james.jeffers · Jan 13, 2010 at 12:09 AM 0
Share

So far, I've only seen this in the editor - I haven't tried it in a build.

avatar image james.jeffers · Jan 13, 2010 at 12:35 AM 0
Share

Ok - tried it in a build and the same problem exists there as well.

I take it then there is no limitation on multiple renderer components in the same GameObject?

avatar image
0

Answer by james.jeffers · Jan 13, 2010 at 12:48 AM

Gah! It was the rotation of the object - it was rendering, but the surface was not facing the camera. Thanks!

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

No one has followed this question yet.

Related Questions

Instantiated objects not visible or rendering 1 Answer

Prefab not rendering when declaring Transform variable 1 Answer

Instantiate an array of prefabs? 0 Answers

Instantiate the subchild (the renderer) from prefab? 1 Answer

Problem with GetComponentinChildren and Instantiate 0 Answers


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