Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Textures are offset 1 pixel to opposite side of plane

Discussion in 'General Graphics' started by KHRZ, Sep 4, 2015.

  1. KHRZ

    KHRZ

    Joined:
    Mar 2, 2013
    Posts:
    56
    So I have a cube made of a plane for each side. When I put a texture on the planes, the texture is offset so that the end of the texture appears on the other side. Using renderer.material.mainTextureOffset and similar functions didn't work in moving the texture around. How can I fix it?

    You can see how the middle borders have colors from the other sides in this picture...
     
  2. Catinightmare

    Catinightmare

    Joined:
    Sep 18, 2013
    Posts:
    11
    what are the settings of your texture in Inspector? it looks like you have the setting "Wrap Mode" set to "Repeat"
    it should be "clamp"
     
  3. KHRZ

    KHRZ

    Joined:
    Mar 2, 2013
    Posts:
    56
    When I do this, the texture doesn't appear. (White was the previous texture it had on). It's not set in the editor but in script though as I am creating the texture with a script.


    Edit: By using both clamp and a small texture offset of 0.1f it turned out correctly.
     
    Last edited: Sep 7, 2015