Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

unity destroy self

Destroy(gameObject);
Comment

unity destroy self


void Update() {
    float y = Random.Range(-4.53f, 2.207f);
    if(x < 2000) {
        GameObject clone = (GameObject)Instantiate(obstacle, new Vector3(y, x * 6.0f, 0),Quaternion.identity);
        clone.AddComponent(typeof(DestroyMySelf));
        x++;
    }
}

Comment

PREVIOUS NEXT
Code Example
Csharp :: remove all letters from string c# 
Csharp :: get all sundays between two dates c# 
Csharp :: get item from icollection 
Csharp :: unity set text value 
Csharp :: make an object disappear from a c# script unity 
Csharp :: c# request run as administrator 
Csharp :: how is c# pronounced 
Csharp :: how to set a objects position to the mouse unity 
Csharp :: transform.rotate unity 
Csharp :: how to delay between lines in unity 
Csharp :: c# get all class properties 
Csharp :: c# console play sound 
Csharp :: c# download string url 
Csharp :: remove last comma from string c# 
Csharp :: alphabet string[] c# 
Csharp :: c# swap variables 
Csharp :: ession in class c# 
Csharp :: best way to compare byte array c# 
Csharp :: c# multiple catch exceptions 
Csharp :: getname of month from date c# 
Csharp :: pyqt qtableview get selected row data 
Csharp :: how to use file watcher in c# 
Csharp :: list with two values c# 
Csharp :: c# check if string is path or file 
Csharp :: new line console c# 
Csharp :: unity 2d player move 
Csharp :: debug c# console 
Csharp :: unity keycode for f 
Csharp :: how to say hello world in c# 
Csharp :: c# array 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =