Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

Material.CopyPropertiesFromMaterial

Switch to Manual
public function CopyPropertiesFromMaterial(mat: Material): void;

Parameters

Description

Copy properties from other material into this material.

// Attach this to a gameObject that has a renderer.
// Copies any property mat has and assigns it to this transform material

var mat : Material;

function Start() { GetComponent.<Renderer>().material.CopyPropertiesFromMaterial(mat); }