Prefab nested prefab showing on the side and color not coming through

Hello,

Sorry for the Vague title, but in short, I have 2 prefabs, 1 is the character window, and the other is the actual player character the player customized from the last panel, the character window is a prefab, and the player character is also a prefab.

the good news is, I do have the player character coming through, but its off to an angle and its in the back of the prefab… not sure how or why, I did check and does have a sprite renderer and made sure it has the high number and sorting layer higher than the Character window…

so how the hierarchy is:
the character window
player character

also to note, the player character is a empty game object with several sprite images for the customization, something similar to:

  • blackthornprod video, 2d customization menu which is the player character, that i want to show on the character window which is also a prefab… i seen nested prefabs: Unity - Manual: Nested Prefabs

but again, the customizations are not coming through and the image is off to the side:

the code is below:

//below is on the Character window prefab
public void Start()
        {
            playerCharacter.SetActive(true);

            GameObject player = Instantiate(playerCharacter);
            player.transform.SetParent(playerCharacterBackground.transform);
            player.transform.localScale = Vector2.one;
           
}

I added pics to the attachment

7549027--933031--character_issue1.PNG
7549027--933034--character_issue1pic1.PNG

You are setting the player to be a child of the playerCharacterBackground but not telling it where it actually needs to be. Aka, what is the transform location. After you figure that out, test it and while it is running, mess around with the Sorting Order and Z values to get it to appear in front.

cool thanks, so i will continue to play around with the sprite renderer and Z axis… but any help or advice on the changes from the customize screen to the room screen? why the changes are not coming over? any recommendations on how or what to do?

I was thinking of instead of using a prefab, to just pass in data, right now I have the player screen as integers, so player selects a particular clothing or color, it is tracked by number, example, blue = 1, red = 2 etc., so should i just make the same image on the player character background and pass in the variables? or prefab is best? looking also to see what is best for performance, though i know phones or computers this is nothing, just thinking of squeezing anything i can do to only make things better.

thanks in advance.