x


why material edit are persistent?

Hi,

Is it normal that when I change a material setting when the game is playing, it doesn't revert to the original setting when I stop? everything else does but the material settings it seems.

Is there a preference somewhere for this or am I missing a point? it's also very weird that material doesn't get reverted when I reimport a fbx, I guess the two problems have a common root isn't it?

Thanks for your help,

Jean

more ▼

asked Sep 07 '10 at 06:39 AM

Jean Fabre gravatar image

Jean Fabre
3.1k 68 75 103

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Changing assets during runtime will change them permanently (basically, any "file" that you have in your Project folder, including skins, materials, scripts, etc). Any instance or game object that you change in the scene(s), however, do get reverted.

If you're doing this via code (you didn't specify), don't use gameObject.renderer.sharedMaterial, instead, use gameObject.renderer.material, this will prevent the material from being "saved".

more ▼

answered Sep 07 '10 at 10:11 AM

qJake gravatar image

qJake
11.6k 43 78 161

(comments are locked)
10|3000 characters needed characters left

I might add to SpikeX's answer that even though Materials in the inspector of a GameObject are shown as though they are "on" that GameObject, this is really just a "shortcut". It still shows the referenced material (that most likely is located in the Project) and edits will be applied to that material.

more ▼

answered Sep 07 '10 at 11:31 AM

runevision gravatar image

runevision ♦♦
8.1k 29 46 112

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x813
x379
x5
x4

asked: Sep 07 '10 at 06:39 AM

Seen: 978 times

Last Updated: Sep 07 '10 at 06:39 AM