You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
417 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MaterialMover : 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(0, offset));
}
}