Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

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);
 }
Comment

PREVIOUS NEXT
Code Example
Csharp :: validating file upload asp.net core mvc 
Csharp :: unity audio 
Csharp :: calculate distance using latitude and longitude c# 
Csharp :: c# dictionary values to list 
Csharp :: relative path c# 
Csharp :: unity rewarded ads 
Csharp :: joins List of strings 
Csharp :: c# read last 10 lines of file 
Csharp :: byte array to base64 c# 
Csharp :: How can I return image from controller asp.net 
Csharp :: basic auth swagger .net core 5 
Csharp :: Entity Framework Core 3.1 Return value (int) from stored procedure 
Csharp :: parent unity 
Csharp :: relaycommand 
Csharp :: c# isdigit mehod 
Csharp :: how to make a character run in unity 
Csharp :: c# remove char from string 
Csharp :: update listbox using class c# 
Csharp :: Change Level in Unity 
Csharp :: sort file name with C# 
Csharp :: c# add element to array 
Csharp :: unity c# change animation 
Csharp :: the .net core sdk cannot be located 
Csharp :: Edit file C# 
Csharp :: msbuild publish to folder command line .net 
Csharp :: c# set cursor to loading and back 
Csharp :: c# wpf timer 
Csharp :: convert number of days into months c# 
Csharp :: autfac .net 6 
Csharp :: c# remove all items from list where item value is null 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =