How to access the ofset of a material

I have a private Vector2 offset = Vector2.zero

When I want to assign the offset variable I have to directly call the matieral like this

offset = material.GetTextureOffset(“string”) what shoud I put in the string cuz i have tried the texture name,the material name ecc. Thank you

You put in the texture name of which you want to retrieve the offset. So, if you want to retrieve the offset of the main texture (which is normally called “_MainTex”):

offset = material.GetTextureOffset("_MainTex");

(you could also just use material.mainTextureOffset)

If you want to retrieve the normal map offset:

offset = material.GetTextureOffset("_BumpMap");

etc.
etc.