Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

TerrainData.alphamapTextures

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

Submission failed

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

Close

Cancel

public Texture2D[] alphamapTextures;

Description

Alpha map textures that store the splat weights of the terrain layers.

Each texture stores four layers, one per RGBA channel. The textures are separate Texture2D objects. Unity adds them to the TerrainData asset as sub-assets only if the TerrainData is already an asset when they are created, so save a new TerrainData as an asset before you assign terrain layers. To make a change to the weights from an Editor script undoable, for example with TerrainData.SetAlphamaps, register both the TerrainData and these textures with Undo.RegisterCompleteObjectUndo before the change. If you register only the TerrainData, undo does not restore the weights.