Quantcast
Channel: Latest Questions by esitoinatteso
Viewing all articles
Browse latest Browse all 92

Flip a Texture?

$
0
0
Hi there! Allow me to ask you another newbie question please... In photoshop I flip a 2d image like this: edit -> transform -> flip; how would I do that in Unity? I mean WITH code. See, I did some web researches but every click draw me even more far away, toward topics related to textures but not to the solution. I know every Shader has this Tiling and Offset thing, and I've read that to flip a texture horizontally you just need to change to -1 the Tiling in your inspector... fact is that I couldn't be able to grasp how to do that with code. I tried a brutish renderer.lightmapTilingOffset = new Vector4(-1,1,0,0) but nothing happens, I also tried renderer.material.mainTextureTiling = new Vector2(-1,0) but ofcourse mainTextureTiling doesn't exist ( why?). I'm ignorant but eager to know how, I'm not asking for plain code, maybe just a push in the right direction... my searches brought me here: http://docs.unity3d.com/Documentation/Manual/ShaderTut1.html; This is pertinent but non exactly what I need here, am I wrong? I also stumbled upon this http://docs.unity3d.com/Documentation/ScriptReference/Material.html but as you can see, there is mainTextureOffset but not Tiling. I'm missing something... thanks a lot for your patience ( AND if it turns out an answer already exist, forgive my thoughtlessness)!

Viewing all articles
Browse latest Browse all 92

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>