Scrolling UVs help

I tried this script Unity - Scripting API: Material.SetTextureOffset

and I can’t get the UVs to move. I am using URP unlit, but i tried other URP material options and none worked.

Is there something I need to do to the material to make this work or there some kind of trick I am missing?

Not really, this should work fine. Can you share the exact code you’re using to do this? Is it the sample one in the URL above?

If so, how are you using this component? Does the object you’ve added it to have a Renderer component in it? (either a MeshRenderer, or a SkinnedMeshRenderer)

Try using “_BaseMap” instead of “_MainTex” as the texture name in material.SetTextureOffset. For some reason that was renamed for the new SRPs.

1 Like

Yes, open the shader up on the material by clicking on Edit in the top right hand corner.
There should be a section with names - if there’s no “_MainTex” in there, that should be your problem - it doesn’t report back anything if you’re referring to it and it’s missing.

1 Like

It was the exact script, I didn’t make any changes.

This was the issue :slight_smile:

I actually hit edit on the shader and _MainTex there but didn’t read the comment above it which said obsolete.