Material CreateCopy()

robot_2Generated
code_blocksInput

Description

The CreateCopy method creates a duplicate of the current Material instance. This can be useful when you need to modify a material without affecting the original instance.

Usage

To use the CreateCopy method, call it on an existing Material object. The method returns a new Material object that is a copy of the original.

Example

// Assume 'originalMaterial' is an existing Material instance
Material copiedMaterial = originalMaterial.CreateCopy();

// Now 'copiedMaterial' is a separate instance and can be modified independently
copiedMaterial.Set("Color", new Color(1.0f, 0.0f, 0.0f)); // Set the color to red