Ahm854
6
Q:

Instantiate c#

// You can use the 'Instantiate()' function to clone a GameObject
clone = Instantiate(original);

// You can also set the position, rotation and parent
clone = Instantiate(original, new Vector3(0, 0, 0), Quaternion.identity, cloneParent.transform);
21
class Program
{
  static void Main()
  {
      Employee employee1 = new Employee();                                
      Employee employee2;
      employee2 = new Employee();                                         
 
      IncreaseSalary(employee1);
  }
}
1
// Instantiates 10 copies of Prefab each 2 units apart from each otherusing UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
    public Transform prefab;
    void Start()
    {
        for (int i = 0; i < 10; i++)
        {
            Instantiate(prefab, new Vector3(i * 2.0F, 0, 0), Quaternion.identity);
        }
    }
}
5

New to Communities?

Join the community