Answers for "how to destroy self in unity"

C#
9

unity destroy self

Destroy(gameObject);
Posted by: Guest on February-01-2021
0

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++;
    }
}
Posted by: Guest on March-14-2022

Code answers related to "how to destroy self in unity"

C# Answers by Framework

Browse Popular Code Answers by Language