Bought an asset with old code

I bought an asset that has animations in it,

Here is the code:

renderer.sharedMaterial.SetTextureOffset (“_MainTex”, offset);
renderer.sharedMaterial.SetTextureScale (“_MainTex”, size);

This is coming up as not valid anymore (I think it was made with Unity 3). Anyone know what comparable code would work with Unity 5?

Thanks

Swap out renderer with GetComponent

2 Likes

Or run the auto updater and it will do this for you.

1 Like