Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

untiy instanciate prefab

Instantiate(prefab, new Vector3(i * 2.0F, 0, 0), Quaternion.identity);
Comment

untiy instanciate prefab


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class InstantiateObjectExample : MonoBehaviour
{
    public GameObject objectToInstantiate;

    private GameObject instantiatedObject;

    private void Awake()
    {
        CreateInstanceOfObject();
    }

    private void CreateInstanceOfObject()
    {
        instantiatedObject = Instantiate(objectToInstantiate, transform.position, Quaternion.identity);

        instantiatedObject.transform.localScale = new Vector3(2f, 2f, 1f);
    }
}

Comment

PREVIOUS NEXT
Code Example
Csharp :: how to change the axis of a Vector3 variable 
Csharp :: unity transparent object 
Csharp :: excel which style property define background color in c# 
Csharp :: c# regex get matched string 
Csharp :: how to make a global string c# 
Csharp :: listview item click c# 
Csharp :: Get key by his value on Dict C# 
Csharp :: make a list c# 
Csharp :: create list with values c# 
Csharp :: what is a protected int c# 
Csharp :: visual studio c# color dialog 
Csharp :: c# ignore enter key 
Csharp :: Celsius to Fahrenheit c# 
Csharp :: asp.net data annotations double 
Csharp :: mvc get base url 
Csharp :: change button color in script unity 
Csharp :: c# get array subarray 
Csharp :: c# csv read write 
Csharp :: list.max c# 
Csharp :: how to look for substring in string in c# 
Csharp :: godot c# export variables 
Csharp :: Throw index out of range C# 
Csharp :: c sharp thread lambda 
Csharp :: raycasting in unity 
Csharp :: how to get the transform of an object in unity 
Csharp :: get text unity 
Csharp :: c# select first value from list 
Csharp :: Squares of a Sorted Array 
Csharp :: datatable linq where clause c# 
Csharp :: adding values to mock IHttpContextAccessor unit test .net core 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =