LocalScale and uv

soooo…
i have cube with adjusted uv mapping. I need to scale it by script. I change it by transform.localScale.
and then custom mapping goes away.

When i apply scale 1st and then custom uv - no changes, its the same. But if i change scale by inspector, everything work as expected.

i check everything, only one way is to change it by “hands”.

question is - how to fix it?\what command i have to use to access scale directly?

edit1: Looks like i found where is problem. When i apply localScale (no matter before or after uv editing) uv coordinates, that read by raycast goes to stock values, but actually texture mapping saved perfectly.

its still issue lol. “How to read “right” uv positions after applying localScale?”

“Only a MeshCollider (with the same mesh) would return the correct UVs.”
yes, that was right.

so, if you are manage to mess with custom, runtime generated UVs, and if u want to draw on it - make sure that mesh with new UVs applied to mesh collider, or new UVs will disappear when u will use corresponded gameobject’s transform.

tyvm everyone, i really appreciate that.