- Home /
drawing spheres at runtime
is there a simle way to add a lot of spheres (like using Gizmos.DrawSphere) at runtime instead of creating a load of gameobjects?
thanks
Comment
Answer by efge · Mar 16, 2011 at 12:06 PM
You could use CreatePrimitive to create a sphere and then change its scale, position, material etc.:
var mySphere : GameObject = GameObject.CreatePrimitive(PrimitiveType.Sphere);
mySphere.transform.localScale = Vector3(...);
mySphere.transform.position = Vector3(...);
Your answer
![](https://koobas.hobune.stream/wayback/20220613113149im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Export objects to a .3DS file at runtime 1 Answer
LoadImageIntoTexture Runtime Change 1 Answer
Assigning sharedMaterial to object built at runtime 2 Answers
INDECIPHERABLE rendering order problem when modifying material property on Runtime 1 Answer
Am I inside a volume? (Without ray cast and default colliders?) 0 Answers