Hey guys. I’m doing this game where I’ll have this scrolling background. I’m currently scrolling the background using a big sprite in the back and animating it using Unity’s animator to change the sprite renderer’s image. So far so good.
I’d like to use a textured quad tho since later on my background will have to scroll in all four directions and scrolling the textures would result in a more manageable code. The problem here is that I also need to animate my background. Now I know about texture offsetting for scrolling it but then I’d lose the ability offset the texture to animate it frame by frame and vice-versa. I tried changing the material’s texture using the animator like I do with sprites but it seems that’s not a parameter that Unity’s animator can change, so the only option would be changing the quad’s Material itself, but I don’t think that creating one material per frame would be really optimal. Any ideas?
I know I could animate it via a script but I’m trying to avoid that for the time being, as I think that kind of thing would start to clutter up my scripts. I’ve also heard that this is not a good approach, optimization wise. Could I possibly use UV animation combined with texture offsetting for this? I’d animate the UVs for scrolling and offset the texture to change animation frames. Is that too resource hungry? I’m targetting mobile btw.