Load game and cinemachine problems

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Load game and cinemachine problems

Post by Esylin »

Hello, I am encountering a problem with cinemachine camera as I load a save game in a scene. I am using Standard Scene Transition Manager and SceneFaderCanvas for load game camera fade in and fade out effect. My game is using Unity 2D.

After the scene is loaded, cinemachine camera will pause then spend about 1~ sec panning left or right trying to focus on my character. How bad the panning is depends on cinemachine softzone settings and SceneFaderCanvas animation duration settings, but it can't be removed by changing those settings.

Trying to give position saver to the camera doesn't work. I also tried to uncheck Pause During Transition but the game freezes after load this way.

Are there any settings that I can change to remove camera panning after load?
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load game and cinemachine problems

Post by Tony Li »

Hi,

Try disabling and then re-enabling the vcam after loading. This should get Cinemachine to jump the camera to its proper position.
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Load game and cinemachine problems

Post by Esylin »

Tony Li wrote: Fri May 26, 2023 3:42 pm Hi,

Try disabling and then re-enabling the vcam after loading. This should get Cinemachine to jump the camera to its proper position.
It kinda worked now, thank you. Though I had to force scene fade in and fade out again after load to hide the camera cut after vcam re-activate. I don't know if there is a better solution for this. ;)
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load game and cinemachine problems

Post by Tony Li »

Hi,

The cut should happen instantly. If it doesn't, let me know, or look at how the code in SequencerCommandCinemachinePriority() does it. Also make sure the SceneFaderCanvas's fade from black lasts at least one frame after loading the new scene, to give your script time to disable and re-enable the vcam.
Esylin
Posts: 45
Joined: Thu Dec 16, 2021 1:21 am

Re: Load game and cinemachine problems

Post by Esylin »

Tony Li wrote: Sat May 27, 2023 4:19 pm Hi,

The cut should happen instantly. If it doesn't, let me know, or look at how the code in SequencerCommandCinemachinePriority() does it. Also make sure the SceneFaderCanvas's fade from black lasts at least one frame after loading the new scene, to give your script time to disable and re-enable the vcam.
Hi, I mainly use Playmaker to control my game logic, so I setup PlayMaker actions in the scene that de-activate/re-activate vcam after a scene is loaded.

Is this the correct way to do it without scripts? :?:
User avatar
Tony Li
Posts: 22131
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load game and cinemachine problems

Post by Tony Li »

Yes, that's fine.
Post Reply