LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Lightmapping.Clear

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function Clear(): void;
public static void Clear();

Description

Deletes all lightmap assets and makes all lights behave as if they weren't baked yet.

Only those assets are deleted that are in the folder with the same name as the scene name AND their name follows the pattern LightmapFar-#.exr or LightmapNear-#.exr.

If LightmapEditorSettings.lockAtlas is disabled, it will also clear the lightmaps array and clear lightmap indices on all objects.

Baked light probes are cleared as well.