Trying to get a texture scroll along Y. The problem is, nothing I’ve tried is working.
I’ve tried scripts from here,here, and here with no luck. I don’t know what’s going on. I even have a renderer on the object with the material I need the texture to scroll on.
The only other part of the script just plays a sound when the player touches it, so I doubt that’s related to the problem.
Anyways, here’s what I currently have:
using UnityEngine;
using System.Collections;
public class DashPadBehavior : MonoBehaviour {
public float scrollSpeed = 0.5F;
void Update()
{
float offset = Time.time * scrollSpeed;
renderer.material.mainTextureOffset = new Vector2(offset, 0);
}
void OnTriggerEnter (Collider other)
{
if (other.gameObject.tag == "Player")
{
audio.Play ();
}
}
}