- Home /
Apply a 2D texture
I am a bit stuck and couldn't find any answers on the internet regarding this. Say that i created a 2D texture called atlas from few sprites in an array using the Getpixel and Setpixels. Now that I have this 2D texture, how do I apply this to a game object or a sprite. How do I do this ? Also how do I get this 2D texture to the assets folder.
Comment
Answer by Remy_Unity · Dec 11, 2017 at 09:24 AM
These docs should help you:
To set the texture :
https://docs.unity3d.com/ScriptReference/Material.SetTexture.html for mesh object
https://docs.unity3d.com/ScriptReference/Sprite.Create.html for a sprite (need to create a new sprite to assign it a texture)
To save the texture to the assets folder:
Your answer
![](https://koobas.hobune.stream/wayback/20220612144348im_/https://answers.unity.com/themes/thub/images/avi.jpg)