Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
8
Question by Jalima142 · Dec 10, 2012 at 05:53 AM · texturetilingtexturingstretch

How to make a texture tile and not stretch

When I apply my texture to a relatively large object, it stretches and doesn't tile, which I need it to. Please help

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
18

Answer by FireGreeks · Jun 12, 2017 at 07:49 AM

I know that this is a really an acient post but here is my answer that I found just exploring around :

  • Go to the object with the texture you want to unstretch

  • Click on the material or texture

  • Go in Main Maps and put the Tiling to the dimensions of your object

alt text


untitlebd.png (25.6 kB)
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DrGonzosGame · Nov 14, 2017 at 08:58 PM 0
Share

Thanks! I always thought that you have to use the Detail $$anonymous$$ask for that, but now I now better. :)

avatar image Deuce2008 · Oct 21, 2020 at 07:27 PM 0
Share

This is awesome! I never knew it was so easy! Thank you so much

avatar image
8

Answer by Graham-Dunnett · Dec 11, 2012 at 12:17 AM

See http://docs.unity3d.com/Documentation/Components/class-Material.html. Just set the Tiling x and y to whatever you need.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Zielak · Feb 15, 2014 at 04:25 PM 0
Share

It's still stretching. In my example I have a cube with changed scale, for example: (80, 5, 5) and texture stretched across that 80 meters long wall.

avatar image DevLurkin · Dec 16, 2014 at 05:25 AM 1
Share

Attach this script to your cube.

avatar image bernardfrancois · Feb 06, 2015 at 07:40 PM 4
Share

I didn't need to add that script. Setting the 'Wrap $$anonymous$$ode' of the texture to 'Repeat' ins$$anonymous$$d of 'Clamp' make this work for me.

See also the answer to the following question: http://answers.unity3d.com/questions/775619/texture-stretches-when-tiled-in-editor.html

avatar image Monica_L22 · Oct 31, 2019 at 03:56 AM 0
Share

Unfortunately, this link is 404 now. T_T

avatar image Chris_Entropy · Oct 31, 2019 at 06:19 AM 0
Share

I think, the API functionality is this now: https://docs.unity3d.com/ScriptReference/$$anonymous$$aterial.SetTextureScale.html

avatar image
2

Answer by KopperNatt · Mar 06, 2017 at 04:13 PM

@Jalima142 Make a material whitch you can add a texture to it. Here's how to do it:

  1. Select the Material in the "project" tab.

  2. Get into the inspector and go to "Secondary Maps".

  3. import your texture asset (if you haven't allready) and drag it in to "Detail Albedo".

Now the texture still should be stretched but to change that:

  1. Do the instruction above this one first or it may not work!

  2. Go to "Secondary Maps" again and there you'll see the setting "Tiling" There you can change the "X" and "Y" change it for the best look. :D

I know I'm late but if someone else want to know now when you cannot enter the link by @Graham-Dunnett

Hope it worked for you :D Glad to help

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by august_unity496 · Aug 26, 2019 at 09:31 PM

I figured how to make it tile without having to change it for each object. although it doesn't attach to a material, you can just attach it to a game object, and it will tile using the tile x, and y in the editor (you will have to change the texture from a script)

 public class GifTexture : MonoBehaviour
 {
     [SerializeField] private float tileX = 1;
     [SerializeField] private float tileY = 1;
     Mesh mesh;
     private Material mat;
     void Start()
     {
         mat = GetComponent<Renderer>().material;
         mesh = GetComponent<MeshFilter>().mesh;
         
     }
 
     void Update()
     {
         mat.mainTextureScale = new Vector2((mesh.bounds.size.x * 
 transform.localScale.x)/100*tileX, (mesh.bounds.size.y * transform.localScale.y)/100*tileY);
     }
 }

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by alexq4p3 · Jun 07, 2021 at 11:31 PM

Set the mesh x, y at the same proportion of the image. if the texture is 720 x 1080... set the scale to something like 72 x 108.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

I need help with textures. 2 Answers

How To Add Textures To GameObjects? 2 Answers

textures vs textureless 2 Answers

Same material, different meshes, different tiling 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges