Page 1 of 1
Assign portrait created by player at runtime.
Posted: Mon Feb 03, 2025 5:12 am
by Dex
Hello! I'm creating a 2D game that features a character creator to allow the user to customize their character's portrait. The created portrait is a sprite renderer for the main body with other sprite renderers as children for the different body part options.
My intern is having some troubles recovering the portrait then assigning it at runtime to the Player portrait in the dialogue system. Could you point us in the right direction?
Re: Assign portrait created by player at runtime.
Posted: Mon Feb 03, 2025 9:57 am
by Tony Li
Hi,
Here are two ways you can handle player-created multipart portraits:
1. Create the portrait in an area offscreen. Point a camera at it, and render that camera to a render texture. Then show the render texture. The
Dialogue System Extras page has a RenderTexturePortrait Example that demonstrates how to do it with 3D models. The process is the same for sprite renderers.
2. Or make a subclass of
StandardUISubtitlePanel for the player's subtitle panel. In this subclass, override the SetPortraitImage() method to compose your multipart player portrait.
Re: Assign portrait created by player at runtime.
Posted: Tue Feb 04, 2025 3:44 am
by Dex
Thanks a lot, we'll try those

Re: Assign portrait created by player at runtime.
Posted: Tue Feb 04, 2025 7:06 am
by Tony Li
Glad to help! If you have questions on either one, let me know.