Skip to content

Format

typescript
Material.SetFloat(name, value)

class: Material

Description

Set the Float value of the current material.

This method assigns the specified floating-point value to the property of the material.

Parameters

param_nametypedescription
namestringName of the property
valuenumberFloat value

Return

typedescription
void

Code Example

typescript
let material = Resources.Load<Material>(Material, "materialId");
material.SetFloat("_Float",5);
let _Float = material.GetFloat("_Float");
Debug.Log("_Float : ",_Float)