Hello,

I’m currently working on a project using ORK Framework, and I’m trying to retrieve multiple portraits for a single combatant to display them in the UI. My goal is to assign and display several portrait variations (e.g., default, battle, support) for a single combatant and dynamically update the portraits based on specific conditions.

I’ve been using combatant.GetPortrait(PortraitTypeAsset) to retrieve portraits, but I’m running into issues:

I’ve successfully defined PortraitTypeAsset instances (like Default, Support, etc.) in the ORK editor.
However, when I try to fetch portraits for these custom types in the code, the returned portrait seems to be null.
Here’s a simplified version of the code I’m using:


var portrait = combatant.GetPortrait(portraitType);
if (portrait != null && portrait.Sprite != null)
{
image.sprite = portrait.Sprite;
Debug.Log($"[INFO] Portrait successfully set for: {combatant.GetName()}");
}
else
{
Debug.LogWarning($"[WARNING] Portrait for type '{portraitType}' not found for: {combatant.GetName()}");
}



ORK Combatant Setting
image

Do you know what the problem is about this?
  • The portrait setup in your combatant shows None selected for the portrait types. Naturally this will not find the portrait if you want to get it for a specific type.
    So, just select the portrait types you want the portraits to be found by.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Problem solved!
    Thanks for the advice!
Sign In or Register to comment.