Scrolling UVs script doesn't work... or I'm not doing it right.

Hi guys. I looked in the script section and found a scrolling UVs script. I pulled it into the project and added to a flat plane with a texture on it. But the texture doesn’t move. (I think that’s what this script is suppose to do) I see a field named Texture Name. Do I just put the name of the texture in this field that I want to scroll… or the name of the material… or the object. Right at default, it says _Main Texture.

What do I have to do to get this to work.

Thanks.

Depending on the script, you will need to create a sprite-sheet, drag the script to a plane, feed it the sheet, fill in the cell number value and/ or frames per second and hit play.

Make sure your sprite sheet looks something like the example given here or here (depending on which script you are using).

Oh ok. That’s what it means?

http://www.unifycommunity.com/wiki/index.php?title=Scrolling_UVs

I’d like to make an animated normal map… kinda like the water prefab has.
I thought it just slid the texture along the surface. Is there a script for that?.. of if not, can Unity take animated pngs?

Here’s the code for scrolling my sky texture. Just place the script on your flat plane object.

Hope that helps. :smile:

using UnityEngine;
using System.Collections;

public class skyAnimate : MonoBehaviour {
	
	public float scrollSpeed = 0.02f;
	
	void Update()
	{
		float offset = Time.time * scrollSpeed;
		renderer.material.mainTextureOffset = new Vector2(offset % 1, 0);
	}
}

How to do this with a Cookie from a light?

Ah thanks. It says there’s a parsing error though. CS8025. Parsing error… sounds like it’s having trouble reading the script maybe? I know it’s a CSharp script, so it should work… hmmm. I can’t run the game because of it.

Is there something linked to the script that I don’t have?

EDIT: I got it working. There was a bracket that got lost when I copied it. Thanks a ton!

How to Scroll the UV of a Light Cookie?