Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

can delet a script?

Discussion in 'Scripting' started by Nixel2013, May 18, 2019.

  1. Nixel2013

    Nixel2013

    Joined:
    May 9, 2019
    Posts:
    143
    I would like to know if there is any way for a script to self-destruct or deactivate after a few seconds through an OnTriggerEnter
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,264
    Nixel2013 likes this.
  3. Dextozz

    Dextozz

    Joined:
    Apr 8, 2018
    Posts:
    493
    enabled = false;

    Simple as that.