!Camera sequence lost after Scene Load!

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
fferrari
Posts: 3
Joined: Tue Jun 16, 2020 1:23 pm

!Camera sequence lost after Scene Load!

Post by fferrari »

Hi,

Whenever I load a new scene all my conversations won't run the assign camera sequence, while maintaining everyting else in the Dialogue System correct.

Does anyone know why this is happening?

Cheers!
Thanks in advance:)
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: !Camera sequence lost after Scene Load!

Post by Tony Li »

Hi,

What's your camera sequence?

Does it refer to a GameObject that no longer exists? Keep in mind that when you change scenes, GameObjects in the old scene will no longer exist, so references to them will no longer be valid. This includes any references that you may have assigned on persistent objects such as the Dialogue Manager. For example, if you've assigned a scene object to a UnityEvent on the Dialogue Manager, then when you change scenes that assignment will no longer be valid, even if you change to the same scene. This is because Unity reloads the scene with new reference values.
fferrari
Posts: 3
Joined: Tue Jun 16, 2020 1:23 pm

Re: !Camera sequence lost after Scene Load!

Post by fferrari »

At the start of conversations I specify this sequence:

Code: Select all

Camera(myAngle)
myAngle is in a Camera Angle Collection object. In every scene I have the dialogue camera, angel collection, event system, dialogue manager, main camera and player.

Is there something else I should keep in all scenes? Everything else in the Dialogue System keeps working tho, usables, proximity selectores, all the conversations and variables and quests!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: !Camera sequence lost after Scene Load!

Post by Tony Li »

Hi,

If possible -- if you use the same camera angle collection for all scenes -- save it as a prefab in the Project view. Then assign the prefab to the Dialogue Manager's Camera & Cutscene Sequences > Camera Angles field. This way you won't lose references.

You can still have special, scene-specific camera angles, too. Just don't assign them to the Dialogue Manager. For example, in DemoScene1 there's a GameObject named 'Terminal Camera Angle'. The Terminal conversation uses this sequence:

Code: Select all

Camera(Terminal Camera Angle,,1);
fferrari
Posts: 3
Joined: Tue Jun 16, 2020 1:23 pm

Re: !Camera sequence lost after Scene Load!

Post by fferrari »

Found a solution!

Included my dialogue camera and angle collection in my Dialogue Manager game object. Deleted all other instances in other scenes. And maintained Don't Destroy On Load and Singleton both ticked. Keeping only one instance of that same game object and child objects across all scenes, keeping all quest progression and variables.

If there's another way I could do this, please tell
:)
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: !Camera sequence lost after Scene Load!

Post by Tony Li »

That's a fine way to do it, too.
Post Reply