Hi,
I have been trying to solve this problem for a long time. But I couldn't find a solution. In scene changes, I run Dialogue: Stop Speech before Engine: Change Scene. I've tried finding and Destroying the GameObject on scene changes but that doesn't work either.
AC: 1.73.0
Unity: 2020.1.2f1
This is the video;
https://drive.google.com/drive/folders/1jD4JtC8p_-1aGxeAZ7O_2MgIhyzSJ5mY?usp=sharing
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The speech bubble appears to transition in once the new scene has loaded - it's not there in the first frame of the new scene.
As your "Transition type" is set to "None", how is it fading in/out? Through a custom script? Try disabling any custom scripts associated with the prefab - does that make a difference?
I do not have any transition script on it. I create a Global Bool Var and set it to false. Then when Loading Menu TurnOn add an action list on it and set Global Bool Var to true and for the Menu TurnOff either to set Global Bool var to False. Then Create a small script:
bool isLoading;
int loadingGlobalVar;
void Update()
{
isLoading = GlobalVariables.GetBooleanValue(loadingGlobalVar);
if (isLoading) Destroy(gameObject);
}
On what object are you adding the script? If this is an attempt to workaround the original issue, leave it off the prefab for the moment so that we can work with AC's original behaviour.
The menu is visibly fading in and out in the video. If it's not automated through the Menu's "Transition type", I can't see how else it might be doing so.
Here's a script that may help us learn what's going on. Add it to an empty in the second scene of your video and repeat the process in the video:
You should then get messages in the Console whenever the Subtitles menu is turned on, detailing the Speech it is displaying. What message(s) appear at the moment the issue occurs when entering the second scene?
" The menu is visibly fading in and out in the video. If it's not automated through the Menu's "Transition type", I can't see how else it might be doing so. "
It was Canvas Group Fade, which I used as Transition Type while you were watching it in the video. For testing purposes, I turned off the transition type to see if the problem was because of this or something else. There has been a misunderstanding here. I am not using any code for Transition.
I added the code to the second scene in the video as you said. But when I faced the same problem, I did not encounter any feedback in console.
This is the scene where subtitle is stuck on screen and you can see there is no console feedback:

But the dialogue stuck on the screen is set like this.

Maybe it can help I don't know.
Thanks for clarifying.
Here's a more simple script that you can attach to the prefab's root Canvas:
This should cause a Console message at the same time I'd hoped earlier. Try again, and if/when a message appears in the second scene, copy/paste the message in full (stacktrace included).
First scene: During my tests, I noticed that it gives 3 feedbacks for a single dialog. It gives instant to the first two. But he gives the third at the time of closing the dialogue.
When I change the scene after the first two dialogues that take place in the first scene.
There were
6 feedbacks
from the two dialogs in the Console. I got two pieces of feedback from the dialogue stuck on the scene.And what is this specific time?
The stacktraces in the second scene suggest the menu is being turned on as a result of speech being triggered. While we get to the bottom of this, make sure there are no ActionLists set to begin in the new scene.
Are any of the ActionLists running at the time of the scene change coming from asset files that are set to survive scene changes?
Enable the AC Status box via the bottom of the Settings Manager. Does it list any ActionLists running once the new scene is switched to?
We can try to find out what speech is being triggered. Open up ActionSpeech.cs, and find the line beginning:
Immediately above it, paste the following:
That will then produce a warning message in the Console each time a new speech is triggered. If you click on it, it should also reveal which ActionList it came from. What are the details of any such messages in the new scene, at the time the issue occurs?
It happens on the thin slice of time when we change a level and a subtitle text is being generated at that precise moment.If the scene change occurs just at the time of the generation of a speech bubble this error happens.
To play the sound when I changed the Source to Adventure Creator, I defined an Action Asset List to run when the Menu is closed. Other than that, I don't use any Action Asset List.
Source : Adventure Creator Test
I was thinking that the source of the problem was Unity UI. I decided to use Adventure Creator as the source. I created the exact same speech in the game using the AC UI. I use two dialogs in the game. There are two versions, Common and Obligatory. If the dialog is Obligatory, I created a TurnOff Action Asset List to play a sound effect when the menu is closed.
This is the Menu settings:
This is the Subtitles_TurnOff:
But, this tests does not fix this problem. Still the Subtitles is stuck on screen.


Add LogWarning to ActionSpeech.cs Tests
I turn back to Source: Unity UI prefab and past your script to ActionSpeech.cs.
This is the feedback coming from Console.
On the second scene I have OnStart Cutscene I delete it and try to reproduce this problem and again its still stuck on the screen.
Please leave any and all custom scripts out of this for the moment. We first need to know if this is an issue with AC by itself - avoid running your custom Action temporarily.
The logs mention a speech with the next "Have you heard about how he died?". In which scene is this present, and how is it run in relation to the speech shown in the video?
If the issue occurs without the presence of custom code, and an AC menu, you should be able to PM me a .unitypackage of the two scene files and your Manager assets. If you can also give instructions on how to get the issue to occur, I'll see if I can recreate it myself.
Solution
I'm speaking in terms of guesses. There is an ActionList running in the background on the stage and if the ActionList is not finished, it creates a problem in scene switching.
Thanks for your quick response Chris.