I’m trying to show an animation on the inside of a cylinder. I have a texture map with two images below each other and every 5 frames I set the texture y offset either to 0 or to 1053 (top/bottom image). In the inspector I can see the y offset change, but on screen nothing happens to the texture. The inside of the cylinder is UV mapped to the top half of the texture. Can I use SetTextureOffset to animate this?
I’ve modified the code to simply scroll using mainTextureOffset, and again in the inspector the y offset changes, but nothing happens in the game. I’m wondering if this can have anything to do with the fact that the texture is tiled on the inside of the cylinder? Or is there something I need to activate before the offset becomes visible?
tmpOffset.x = 0.0f;
tmpOffset.y = currAniFramenr++;
ren.material.EnableKeyword("_MainTex");
ren.material.mainTextureOffset = tmpOffset;
I know I have the correct renderer because I can see the original texture and below I see the offset.y value change during gameplay. The inside of the cylinder is UV mapped to the top half of the texture.