Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

material doesnt change after resetting scene

Discussion in 'Scripting' started by alexchandriyaa, Jun 1, 2018.

  1. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    Capture.PNG actually i created scratch card functionality for this am using plane with material in it but whenever i reset scene material doesnot change.. i attached screenshot at first i scratched few area after resetting my scene the scratch card should be perfect but it displays where i left last time
     
  2. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    287
    any changes of a material runtime is saved in the editor.
     
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,042
    You need to change an instance of the Material, not the original.

    But you're asking this in General Discussion, which is explicitly not a support forum. Scripting would be the place for this.
     
    hippocoder likes this.
  4. alexchandriyaa

    alexchandriyaa

    Joined:
    Jan 18, 2017
    Posts:
    140
    yes how to reset that to default?
     
  5. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    287
    You can't reset to the previous values unless you kept a separate copy of the material. Otherwise you'll have to change them manually again.

    To avoid this happening again do like angrypenguin said, create an instance of the material and reference the instance in script.