Hello, tell me, please, is it possible for unity to cut a sprite into several different layers?
For example, I have a 2D game, there is a solid sprite of a room, this sprite has an area (something like a door) where the layer should overlap the character, is it possible to select this area in unity and move it to another layer? or is it necessary to draw a piece of wall separately in a graphic editor and place it on a separate layer already ?
You can change the layer of a sprite renderer dynamically through code, but layers are bound to the renderer. So to be able to sandwhich something in between, you do need separate renderers and thus separate sprites.
Technically you could use GetPixels methods to extract something from an existing sprite texture and generate a new one at runtime, but that’s a hassle.
1 Like
It is also possible to create multiple sprites from single texture using Unity sprite editor feature. Just need to set the texture mode to “multiple” before. See Unity - Manual: Sprite Editor . But unless you are working with simple rectangular shapes or spritesheets where components have sufficient gap between them, it will probably be easier to do in graphic editor.
1 Like