Hi Tony,
thanks for your quick reply. (and sorry for hijacking this thread, maybe we should move to a new one?)
Anyways, unfortunately I run into several issues with the provided solution
1. If importing the package to a new Unity (2019.3.0f6) project, the conversation works, but:
1a. if I change e.g. Sequence "NPC3 Portrait" to the suggested "[var=Actor] Portrait", it does not work (I assume it's because getting the Actor variable always returns the dialogues "Actor" which is "NPC 2" for the entire conversation where it should change based on who is speaking, in this case "NPC 3")
1b. this leads me to the 2. problem: if I now change the conversations' Actor from NPC2 to NPC3 (and due to this change correct sentence 2 to "Actor NPC2 - Conversant NPC1")I get the warning "Game Object with animator is inactive" when NPC2 should say its line (I assume this is because [var=Actor] does not work on NPC2 now that the conversations' Actor is NPC3).
1c: this leads me to a more general issue; for several reasons it would be very unpractical if I needed to define a custom sequence for each sentence referencing to a static GameObject name (as it would be required to solve 1a+1b when changing the conversation Actor to NPC3 and then its only possible to use [var=Actor] for NPC3 whereas "NPC1 Portrait" and "NPC2 Portrait" now have to be static strings).. with other words, for each actor that is not the conversations' actor, I would need to add a custom sequence referencing to a static game object name, which can easily become a big problem later on if changes are needed..
-> what I'd like to do (for many other simplification reasons) is to use the "Default Sequence" in "Camera & Cutscene Settings" (no custom sequence on each sentence) where I put in "AnimatorPlay(Talk, speaker);AnimatorPlay(Idle, speaker)@{{end}}" - but when I do this (and remove the Sequence in each sentence) I only get the warnings "Animator.GotoState: State could not be found" followed by "Invalid Layer Index '-1'" (when Debug.Log Sequencer.cs line 1396 "subject", I get e.g. "NPC1" Transform and not "NPC1 Portrait" of course, because NPC1 is the speaker) - would there be a way to access the "NPC1 Portrait" in the "Default Sequence" ?
2. Assuming (1) can be solved via the "Default Sequence", I would run into another even bigger issue with the suggested solution: I have many actors (for now 3, but they will go up to 10-20 and eventually be hundreds) and many different speech bubble prefabs (currently 23, defined by their shapes like angry, whisper.. and some unique settings) re-used on many "pages" (imagine a series of books). If I would need to have a prefab variant for each actor and each speech bubble, I would at least now already need 3 x 23 = 69 prefab variants for uniquely naming the portrait according to your suggestion ("NPC3 Portrait" and so forth..) and with each newly introduced actor, this would grow fast. Plus, I prefer the "instancing prefab" way of a speech bubble over having all of them in the scene (e.g. because the speech bubble does some internal setup on instancing and positions itself based on the Actors anchor - I would need to do this for all many speech bubbles manually if I do not use the "instance way").
-> so I really would like to keep it that way that 1 speech bubble shape gets instanced and has the same "Portrait Image" GameObject name (=portrait) independent from the actual speaker that speaks via the bubble.
Since the "Standard UI Subtitle Panel" already knows the "Portrait Image" (and thus where the Animation Controller is), I think it might be a solution to define the animations in the way the "Visibility" animations are defined (so on "Standard UI Subtitle Panel" I define "Talking" and "Idle" as the animations that are played on "Portrait Image" Animation Controller.
Or as another way, using the "Default Sequence", it plays the Animations (Talking, Idle) on the "Portrait Image" Game Object of the instanced speech bubble (+ it doesn't matter that there are several Game Objects with the same name, since its always one speaker that speaks with one "Portrait Image" associated..
I have the feeling that it is a bit hard to describe the exact setup or what I am trying to achieve (or I would need to bother you with even more explanation text
... maybe it would be easier if I showed you the setup/problem e.g. via Skype/Screensharing. I have good experiences with that on other Unity Asset Store questions/communication. If that would be an option for you as well, please send me a PN and we could arrange a quick call.
Thanks Michael