Hi, I've come across a small issue when setting a conversation in c# for an NPC. I'm using something like:
NPC.GetComponent<ConversationTrigger>().conversation = "Example/Conversation";
This results in a "Conversation not found in database" warning. However, if I set it to a conversation not in a subfolder, e.g. just "Conversation", it works fine. So basically it's not currently working for any conversation I have in a sub folder. I have a feeling I'm missing something obvious, but coffee isn't helping my brain figure it out. Any help would be appreciated!
Issue with setting conversation in c#
Re: Issue with setting conversation in c#
Hi!
That should work. Are you perhaps using a backslash ( \ )? If so, this will cause C# to interpret it as a special character (e.g., "\n" is a newline). Or is there a blank space somewhere in the conversation title (e.g., "Example /Conversation")? (Note the blank space at the end of "Example ".) Also, try using a literal string such as @"Example/Conversation":
That should work. Are you perhaps using a backslash ( \ )? If so, this will cause C# to interpret it as a special character (e.g., "\n" is a newline). Or is there a blank space somewhere in the conversation title (e.g., "Example /Conversation")? (Note the blank space at the end of "Example ".) Also, try using a literal string such as @"Example/Conversation":
Code: Select all
NPC.GetComponent<ConversationTrigger>().conversation = @"Example/Conversation";
-
- Posts: 7
- Joined: Thu Jun 29, 2017 5:43 am
Re: Issue with setting conversation in c#
*slaps forehead* You were right, there's a space in the conversation title I was testing. Problem solved. Thanks!
Re: Issue with setting conversation in c#
Happy to help!