Page 1 of 1

!Camera sequence lost after Scene Load!

Posted: Tue Jun 16, 2020 1:31 pm
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:)

Re: !Camera sequence lost after Scene Load!

Posted: Tue Jun 16, 2020 2:06 pm
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.

Re: !Camera sequence lost after Scene Load!

Posted: Tue Jun 16, 2020 3:03 pm
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!

Re: !Camera sequence lost after Scene Load!

Posted: Tue Jun 16, 2020 3:30 pm
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);

Re: !Camera sequence lost after Scene Load!

Posted: Tue Jun 16, 2020 3:31 pm
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
:)

Re: !Camera sequence lost after Scene Load!

Posted: Tue Jun 16, 2020 3:46 pm
by Tony Li
That's a fine way to do it, too.