- Home /
Question by
ina · May 07, 2012 at 10:05 PM ·
gameobjecttexturescaleruntime
Keeping textures unstretched even as a gameobject scale is changed
How do you keep textures unstretched while having the gameobject scale changing during runtime?
Comment
Answer by Drakestar · May 07, 2012 at 10:47 PM
Generally you don't without recalculating the UVs at runtime. Start looking here: http://unity3d.com/support/documentation/Manual/Generating%20Mesh%20Geometry%20Procedurally.html
Depends on what the exact use case is. I'm assu$$anonymous$$g you're not just doing a simple uniform scale, since that would stretch the texture uniformly, as well. Whatvexactly are you trying to do?
You can use a shader that takes world coordinates ins$$anonymous$$d of UV coordinates- depends on your use case.