Hi Tony,
My game has multiple characters the player can select from. Each character is a unique prefab and based on which one the player selected the selected character's index will be stored in a variable. I want each character to have a different set of portraits during dialogue. Currently I am going at this by setting a different actor for each character with different portraits, but I don't know how to get my characterIndex variable before a conversation and set the corresponding actor during runtime.
Changing conversant based on variable before conversation starts.
Re: Changing conversant based on variable before conversation starts.
Hi,
How are you starting conversations?
Let's say you have a GameObject for each conversant. Each of these GameObjects has a Dialogue Actor component whose Actor dropdown points to the correct character.
If you're starting a conversation in C#, you can pass the GameObject to DialogueManager.StartConversation(), such as:
If you're starting the conversation from a Dialogue System Trigger, you can make a subclass of DialogueSystemTrigger. Example:
How are you starting conversations?
Let's say you have a GameObject for each conversant. Each of these GameObjects has a Dialogue Actor component whose Actor dropdown points to the correct character.
If you're starting a conversation in C#, you can pass the GameObject to DialogueManager.StartConversation(), such as:
Code: Select all
GameObject conversant = CharacterIndexToConversant(characterIndex); // (Example)
DialogueManager.StartConversation("title", playerTransform, conversant.transform);
Code: Select all
protected override void DoConversationAction(Transform actor)
{
conversationConversant = CharacterIndexToConversant(characterIndex).transform;
base.DoConversaitonAction(actor);
}