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(
Quaternion.identity) as GameObject;
In this case, "Waypoint" is the name of the prefab.
Thanks in advance!
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.
Gah! It was the rotation of the object - it was rendering, but the surface was not facing the camera. Thanks!