Forum rules - please read before posting.

Character portrait in SubtitleUI does not update everytime

Hey everyone,

Long Story Short:
I have been working with adventure creator for quite some time now and what i am trying to achieve is to have the character portrait graphic update so that the subtitle UI reflects it every time it appears. This Portrait Graphic could change for every dialogue.
Hence i had an array of textures that would update the portrait graphic of that character when they say a dialogue and set up a script with an array of dialogue, and an action list that triggers the dialogue. When the dialogue is triggered i set both the character as the parameters and their dialogue is also set based on the dialogue array. The characters in scene do have their Portrait Graphic changing but this does not reflect in the UI Image. Only the default image set is displayed but the updated image does not reflect. Any ideas on how to update this.

Thank you!

Comments

  • What are your AC and Unity versions, and does the Portrait Graphic update correctly if you temporarily switch the Menu's Source back to Adventure Creator?

    I'm not clear if you're using custom scripting here, or just the tools AC provides. I'm assuming that you're seeing the Portrait Graphic changing in the character's Inspector.

    Does the Menu itself have its Appear type set to When Speech Plays? Best to share screenshots so that we can better understand what's going on.

  • Hi Chris,

    Sorry for the delayed response.

    Unity Version - 2019.2.9f1
    Adventure Creator Version - 1.69.2

    Switching the Menu's source to Adventure Creator does not display the Portrait image.

    I am using a custom scripting here. The portrait graphic does change in the character's Inspector.

    Script Screenshot:
    https://imgur.com/hJhkybz

    The Action List associated with the script: https://imgur.com/wlJxbWa

    The menu has its appear type set to When Speech plays.
    Screenshot:
    https://imgur.com/3D9Ie9D

    Thanks.

  • Portrait graphics cache themselves internally, so as to avoid sprite-conversions every frame. If you're changing the graphic's texture through script, you likely just need to clear these caches.

    Try calling these after updating the texture:

    playerCharacter.portraitIcon.ClearSprites ();
    playerCharacter.portraitIcon.ClearCache ();
    
  • Works like a charm. Thanks a lot Chris! :) <3

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.