Im not good in english.
Hi. I have a problem. I want make scrolling texture but scripts what I found scrolls only one material on mesh. My mesh have 4 materials and i need scroll only the one that I want.
This is the script:
using UnityEngine;
using System.Collections;
public class Scrolling: MonoBehaviour {
public float scrollSpeed = 0.5F;
public Renderer rend;
void Start()
{
rend = GetComponent<Renderer>();
}
void Update()
{
float offset = Time.time * scrollSpeed;
rend.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
}
}