Here I go again
I am facing an issue where I am trying to trigger a Conversation Trigger on an NPC from script.
I have been able to do so form my own code by:
- setting the trigger condition of the Conversation Trigger to either 'OnEnable' or 'OnStart' (both work)
- making the Convertation Trigger component inactive from the beginning;
- Once the player enters the OnTrigger zone, I orient the NPC towars the player;
- setting the Conversation Trigger to 'enabled', which then initiates the conversation;
- during the course of the conversation, I switch the Conversation Trigger component to another conversation related to Quest completion;
- when the player exits the zone, I deactivate the Conversation Trigger component;
- when the player re-enters the zone, I orient the NPC towards the player;
- I re-activate the Conversation Trigger component;
...nothing happens, the conversation is never triggered.
Any ideas to what I might be doing wrong?
Thanks,
-Jeff
Using a conversation Trigger multiple times for different Conversations
Re: Using a conversation Trigger multiple times for different Conversations
Hi Jeff,
OnStart is only called once, regardless of how many times you disable and enable a component. OnEnable should work the way you describe. If it doesn't, check the Console for any relevant logs. You may want to temporarily set the Dialogue Manager's Debug Level to Info for more details.
If I may make a suggestion, set the Conversation Trigger to OnUse. When you want to start a conversation, invoke the OnUse() method. This way you don't have to fiddle with disabling and enabling the component.
Another possibility is that the Conversation Trigger's Condition isn't true.
OnStart is only called once, regardless of how many times you disable and enable a component. OnEnable should work the way you describe. If it doesn't, check the Console for any relevant logs. You may want to temporarily set the Dialogue Manager's Debug Level to Info for more details.
If I may make a suggestion, set the Conversation Trigger to OnUse. When you want to start a conversation, invoke the OnUse() method. This way you don't have to fiddle with disabling and enabling the component.
Another possibility is that the Conversation Trigger's Condition isn't true.
Re: Using a conversation Trigger multiple times for different Conversations
Ok Tony, I will go for OnUse, this will make it more manageable. Thank you!