Quantcast
Channel: iOS and tvOS
Viewing all articles
Browse latest Browse all 10823

Dynamic creation of Spheres in C#

$
0
0
I'm having a lot of trouble doing this. Basically I want to randomly generate an unset number of spheres on screen with different positions. All the nodes are exactly the same, except for positions. Here is how I tried to do it:

for (int i = 0; i<7; i++)
{
Vector3 v = new Vector3 (RandomNumber (10, 471), RandomNumber (10, 310), 0);
GameObject s = new GameObject ();
s = GameObject.CreatePrimitive (PrimitiveType.Sphere);
s.transform.position = v;
myNodes.Add (s);
}

All...

Dynamic creation of Spheres in C#

Viewing all articles
Browse latest Browse all 10823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>