Animate a GuiTexture to make a spinning object

I've been looking around for this and most of the other answers didn't help or were wrong somehow.

I've basically copied what this JavaScript does (but re-wrote it in c#). Unfortunately this script is for controlling materials on a 3d object and not a Gui Texture.

So what I've got so far, is created the strip of images of the object spinning on each frame. Set the texture on the GuiTexture, and played around with the width and right border values to get it to show just one frame.

The problem I'm having is being able to set the offset of this texture, but I can't do it like in the link. I also can't seem to edit the border values through script so I won't be able to change width and border values to do it.

By the looks of it, I think I'm going to have to have to resort to this instead, since it seems like the only possible way for it to work. Yay for having to recreate every single frame into it's own image and using an array of Texture2D.

GUITexture is very limited. But it's limitations make it stronger for what it does do well, making GUIs. What you are trying to do will not work, to best of my knowledge with guitexture, but you should be a ble to do it with a regular 3D object, even as part of a GUI.

EDIT: Try looking at this, specifically the character visual setup. I uses a sprite sheet for a topdown. http://www.rebelplanetcreations.com/downloads/Other/Tutorials/HowToMakeAGameInUnity3D.pdf

Can't change tiling or the scroll of a gui texture so my only solution was to either make a plane and set that to camera.nearplane (or wahtever it's called) or scroll through different textures using a similar code for frames per second. This second option is what I chose.

I made a separate image for each frame and set them into cache using numbered names for each image during the awake function.

using this in ongui, I could scroll through them at a good constant speed and create my animated gui.

// Calculate index
curFrame += Time.deltaTime * frameScrollSpeed;

// repeat when exhausting all frames
int index = Mathf.FloorToInt(curFrame) % guiPic.Length;

// change frame according to index
GUI.DrawTexture(new Rect(10, 8, 30, 28), guiPic[index]);

frameScrollSpeed is a float of the speed I wanted. guiPic is an array of type Texture2D.