Sprite Layers query - grouped layers?
Hello!
So this is more of a query then anything else. I've been using Unity to create characters made of multiple different Sprites and they are stacked on different rendering layers in Unity. However I need to know if there's a way to "group" them so the entire character renders as one object. For example if two characters were to pass each other in front of the camera, the camera would only render the pieces on the front layers. This might be easier to explain via example;
So here I have two versions of the Player Character. In the scene the player on the right is in closer to the camera then the player on the left. However because they share render layers they do this;
So what I'm essentially asking is if there's a way to group sprites on these layers into a single layer, so that the characters may pass each other without coming out like some freakish monstrosity. The aim is so that my characters are 2D and can run around in 3D, as I'm trying to create a very "sketchbook" style of game. Any help whatsoever is appreciated!!
Answer by FortisVenaliter · May 18, 2016 at 09:07 PM
Yes, you need to group them into a base object. The UGUI renders in the order of the objects in the hierarchy, so if they are grouped into a single parent object, those objects would be evaluated and rendered separately.
Although from your post, it kind of sounds like you are doing this already...? Can you post a screenshot of your hierarchy view?
Thanks for your response, see below
The Player character is an Empty Parent that houses all the sprites together, the idea being then I can move the whole thing at once rather then potentially clicking dozens of sprites.
Okay, so you're not using a canvas.... that's an important piece of information... What component are you using to render the images? Is there a reason you aren't using the built-in 2D canvas functionality?
I'm not sure what you mean by 2D canvas. I'm looking in the Unity manual and it seems that's for UI stuff, like menus?
Your answer
Follow this Question
Related Questions
Combine 3D and 2D engines 0 Answers
How to make a pseudo 3d object change sprites (animations) based on where the player is facing it 0 Answers
2.5D Game: How to move main Character in X & Y Axis with ability to rotate? 1 Answer
Cover overlay sprites with geometry 0 Answers
Screen to World Point on 2.5D game 0 Answers