Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

How to create a Texture2D from a sprite asset

$
0
0
I need to change the `sprite` property of a `SpriteRenderer` component programmatically. The `Sprite.Create()` function takes a `Texture2D` object, which is the sprite image. I have a sprite sheet that is split into sprites automatically by Unity. How do I make a `Texture2D` object from one of these sprites?

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>