- Home /
Question by
joeybubble1 · Aug 06, 2012 at 05:05 PM ·
camerarendertexturemirrorflipinvert
Flip a render texture?
Basically, the title says all, is it possible to flip a render texture, and if so, how would I do it?
Thanks Tz
Ps. Sorry for the "One Line" question...
Comment
Best Answer
Answer by Meltdown · Aug 06, 2012 at 07:05 PM
Set the scale of the object your render texture is assigned to -1. So if you want to flip it horizontally set the x scale to -1.
Answer by asimov · Aug 06, 2012 at 06:45 PM
Hi Joe,
I'm assuming you're just asking how to change a texture on a renderer.
If so, you need to access the renderer component on the object. Assuming the script is attached to the object whose texture you want to change, you can use:
public Texture NewTexture; // Drag texture into slot from Inspector
gameObject.renderer.material.mainTexture = NewTexture;
I hope that helps.