Reply To: Multiple Npc Talking

Home Forums Books Mastering Unity 2D Game Development Multiple Npc Talking Reply To: Multiple Npc Talking

#8394

Oh no worries.

I tested this locally and I think what is tripping you up is the event subscription.  If you are using the same event subscriber for both characters (basically you are shouting to everyone) only the first conversation will start.

Ideally, you need to set up a new event channel for the second character (new subscription list in the Messaging manager and supporting functions) and Broadcast // receiver scripts for the new character.

While this may seem a bit bulky, it still means you have a robust system that is reusable and doesn’t collider with any other kind of messaging and does not require hard coding.

Granted, it would be improved (in fact I added an option in my local script to update the “completed” status of a conversation when it had finished, so that you wouldn’t see it twice)

With the new UI system, it brings a new style of event system which is a lot more flexible, so if you saw my announcement about a set of articles to update the GUI system to the new UI system, it will cover that as well.  As ever buying the UI book isn’t mandatory and I’ll ensure you get all the info you need in the extended tutorial (although preferred obviously :D, as there is a lot of information about the UI system in the new book)

 

Hope this helps.

 

P.S.

If you want me to share the script updates I did for subsequent character conversations, let me know and I’ll post them.

Simon (Darkside) Jackson
@SimonDarksideJ