Search Unity

How to repeat texture when object is increases in size

Discussion in '2D' started by Sling_Knight, Feb 23, 2019.

  1. Sling_Knight

    Sling_Knight

    Joined:
    Feb 1, 2019
    Posts:
    1
    In my code, I have game objects with an associated prefab. Later in the code, the objects have a scale transformation applied. When this happens, the texture increases in size to match. Is there a way to make the texture repeat instead of scaling with the object?
     
  2. Geejayz

    Geejayz

    Joined:
    Feb 8, 2016
    Posts:
    73
    Find the texture itself in your projects folder. Look for 'Wrap Mode' in the inspector and set this to 'Repeat'. Hopefully that does what I think it does :)
     
  3. ed_s

    ed_s

    Unity Technologies

    Joined:
    Apr 17, 2015
    Posts:
    165
    Yes, that should do it.

    You can find a bit more about TextureWrapMode here:

    https://docs.unity3d.com/ScriptReference/TextureWrapMode.html
     
    brutecold likes this.