Answers for "destroy(gameobject[i]);"

C#
16

destroy gameobject unity

Destroy(this.gameObject);
Posted by: Guest on March-16-2020
-2

destroy gameobject unity

void OnTriggerEnter()
{
    if(PlayerPrefs.GetInt("GotPotion", 0) == 0)
    {
        // You didn't get the potion yet, so get it
        Destroy(gameObject);
        PlayerPrefs.SetInt("GotPotion", 1); // got the potion
    }
}
Posted by: Guest on March-24-2022

Code answers related to "destroy(gameobject[i]);"

C# Answers by Framework

Browse Popular Code Answers by Language