Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to instantiate a gameobject

/// <summary>
/// Creates a new Gameobject prefab called Name_1 for example
/// Instantiates the prefab
/// </summary>
public void AddGameObject()
{
	//created for example only
	GameObject testPrefab = new GameObject("Name_1");
    Vector3 objectPOS = Vector3.zero;

	GameObject newGameObject = Instantiate(testPrefab, objectPOS, Quaternion.identity);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to write int array to console c# 
Csharp :: escape double quotes c# 
Csharp :: asp.net data annotations double 
Csharp :: c# combobox selected item 
Csharp :: c# byte array to file 
Csharp :: get any random item in array c# 
Csharp :: disable rigidbody unity 
Csharp :: c# console wait for input 
Csharp :: get last element in a list vb.net 
Csharp :: sort array by parity 
Csharp :: total months between two dates c# 
Csharp :: scenemanager.loadscene 
Csharp :: No Entity Framework provider found for the ADO.NET provider with invariant name 
Csharp :: unity post processing ui 2d 
Csharp :: c# convert int to string 
Csharp :: prevent asp button from postback 
Csharp :: unity c# random number 
Csharp :: optimistic update 
Csharp :: wpf app how to get all elements 
Csharp :: connection string in asp.net with username and password 
Csharp :: database update dotnet 
Csharp :: unity color by rgb 
Csharp :: billboard canvas unity 
Csharp :: c# datagridview change selected row color 
Csharp :: c# decimal vs double 
Csharp :: The entity type has multiple properties with the [Key] attribute. 
Csharp :: hcf of numbers 
Csharp :: wpf resource dictionary 
Csharp :: c# replace dash in string 
Csharp :: .net mvc return a specific View 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =