Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

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

Material.SetFloat

SetFloat(propertyName: string, value: float): void;
SetFloat(nameID: int, value: float): void;

Description

Set a named float value.

	function Start () {
		// Use the Specular shader on the material
		renderer.material.shader = Shader.Find("Specular");
	}

function Update () { // Animate the Shininess value var shininess : float = Mathf.PingPong (Time.time, 1.0); renderer.material.SetFloat( "_Shininess", shininess ); }