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.

Description

Tiles the texture, creating a repeating pattern.

When UVs are outside of the 0...1 range, the integer part will be ignored, thus creating a repeating pattern. See Also: Texture.wrapMode, texture assets.

	renderer.material.mainTexture.wrapMode = TextureWrapMode.Repeat;
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        renderer.material.mainTexture.wrapMode = TextureWrapMode.Repeat;
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		renderer.material.mainTexture.wrapMode = TextureWrapMode.Repeat