hello!
is it possible to move the Canvas child object from the DialogueManager prefab?
When I tried, the conversations wouldn't play anymore.
moving canvas out of dialogue manager prefab hierarchy
-
- Posts: 17
- Joined: Tue May 16, 2023 11:41 pm
Re: moving canvas out of dialogue manager prefab hierarchy
It's fine to move the canvas out of the Dialogue Manager GameObject if your game is contained in one scene. The Dialogue Manager is a persistent singleton. This, and its repercussions, are explained in How To: Manage Player Controls and Scene Changes.
What's the reason for moving the canvas? I may be able to suggest a better solution.
What's the reason for moving the canvas? I may be able to suggest a better solution.
-
- Posts: 17
- Joined: Tue May 16, 2023 11:41 pm
Re: moving canvas out of dialogue manager prefab hierarchy
I'm moving it to under a UIManager object which is also a peristent singleton - not sure if that helps!
The reasoning is mostly just for keeping track of things, and being able to easily reference all the canvas active in a scene via the UIManager!
The reasoning is mostly just for keeping track of things, and being able to easily reference all the canvas active in a scene via the UIManager!
Re: moving canvas out of dialogue manager prefab hierarchy
That's fine then. As long as they're both persistent singletons, they'll stay in sync.
-
- Posts: 17
- Joined: Tue May 16, 2023 11:41 pm
Re: moving canvas out of dialogue manager prefab hierarchy
I see! For some reason though, the conversations won't play if I move the canvas out of dialogue manager's hierarchy?
Is it because it breaks the prefab or some other connection?
Is it because it breaks the prefab or some other connection?
Re: moving canvas out of dialogue manager prefab hierarchy
Yes, almost certainly. The Dialogue Manager survives scene changes. If it points to GameObjects that do not also survive scene changes, those references will become invalid. Related info here: How To: Manage Player Controls and Scene Changes
-
- Posts: 17
- Joined: Tue May 16, 2023 11:41 pm
Re: moving canvas out of dialogue manager prefab hierarchy
But the canvas does persist across scenes? As in I'm moving the canvas from under the DialogueManager (singleton) to under UIManager (singleton).
Re: moving canvas out of dialogue manager prefab hierarchy
Hi,
I can't say without more information. When you enter play mode, does the Dialogue Manager's Display Settings > Dialogue UI field still point to a valid dialogue UI?
And when you change scenes, does it still point to a valid dialogue UI?
If so, then are there any errors or warnings in the Console window when you try to start a conversation?
I can't say without more information. When you enter play mode, does the Dialogue Manager's Display Settings > Dialogue UI field still point to a valid dialogue UI?
And when you change scenes, does it still point to a valid dialogue UI?
If so, then are there any errors or warnings in the Console window when you try to start a conversation?