instantiate object in circle
float radius = 1f;
int amountToSpawn;
for (int i = 0; i < amountToSpawn; i++)
{
float angle = i * Mathf.PI*2f / amountToSpawn;
Vector3 newPos = new Vector3(Mathf.Cos(angle)*radius, y, Mathf.Sin(angle)*radius);
GameObject go = Instantiate(GameObject.CreatePrimitive(PrimitiveType.Cube), newPos, Quaternion.identity);
}
Also in C#:
- visual studio C# hintergrund bild ändern
- sum the digits in c#
- unity separator in inspector
- convert string to decimal c#
- unity line renderer position count
- 2d object look at object
- how to hide and show object in unity script
- c# list remove item based on property duplicate
- c# round to closest multiple
- c# clear console read chache
- download and run exe c# 1 button
- rotate to face direction
- c# length of array
- how to reduce garbage collection c#
- what data type should be for contact number in asp.net
- uncaught syntaxerror invalid or unexpected token unity webgl
- switch statement
- check if two timespans intersect c#
- string isnullorempty vs isnullorwhitespace
- get what week of the month c#
- reverse a string in c#
- unity cancel invokerepeating
- winforms c# add data to datagridview with a button