is it possible to add a 3d text on an object which was spawned through a script for example,
GameObject sphere = GameObject.CreatePrimitive (PrimitiveType.Sphere);
can you add a 3d text above it through script?
is it possible to add a 3d text on an object which was spawned through a script for example,
GameObject sphere = GameObject.CreatePrimitive (PrimitiveType.Sphere);
can you add a 3d text above it through script?
If I were you, I’d make a prefab with your primitive and a text mesh placed under it, and then instantiate the prefab from script.
You CAN also create your sphere, create an empty game object, put a text mesh component on there, put a mesh renderer component on there, set the text game object’s parent to the sphere game object’s transform and then put in the local coordinates for the text mesh that will make it be above the sphere. I guess that would work, never tried it. Seems like a lot of work!
In most cases I think the prefab solution would be better. There’s some docs on instantiating prefabs at runtime here