Search Issue Tracker
By Design
By Design in 3.1.X
Votes
1
Found in [Package]
3.1.4
Issue ID
CMCL-1722
Regression
No
Cinemachine2D bounds are not calculated properly when switching cameras position for the first time
Steps to reproduce:
1. Open the attached project “Promoted!.zip”
2. Open the “Demo“ scene
3. Enter Play mode
4. Walk with the character to another area (you can go to left side)
5. Observe the Game view when going through different areas
Expected result: Camera switches to another area
Actual result: Camera switches to unexpected position and switches to expected position in a split of a second
Reproducible with: 3.1.0(6000.3.0b4, 6000.4.0a1), 3.1.4(6000.0.58f1, 6000.2.7f1, 6000.3.0b4, 6000.4.0a1)
Could not test with: 3.0.1 (6000.3.0b4)(Project has too many errors)
Note: The strange behavior can only be seen going to another area for the first time after entering Play mode
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Prefab Overrides “Apply” button is too big and overlaps with the context menu’s outline
- Prefab Overrides “No Overrides” text is too large, and the the Context Menu of the Parent GameObject has a lot of empty space when opened
- “Screen position out of view frustum...” errors are thrown when zooming out in the Scene view after creating UI GameObject
- CurveTexture is not being released when unloading AssetBundle containing a Scene with ColorCurves post-processing component in Global Volume
- Crash on ExtractActiveCasterInfo when navigating the scene view in a project with specific lighting data
Resolution Note:
This is expected behaviour.
Confiners can take a few frames to warm up. When CinemachineCameras are activated using Priority and have StandbyUpdate set to RoundRobin, the warming up will occur in the background.
This project, however, enables and disables components to activate the camera. This is fine, but it will prevent the background warming up from occurring.
An easy workaround is to add the following script to the confined cameras (I added it to the CinemachineCamera prefab, and it solved the problem):
using Unity.Cinemachine;
using UnityEngine;
public class WarmUpConfiner : MonoBehaviour
{
private CinemachineConfiner2D m_Confiner;
private CinemachineVirtualCameraBase m_Vcam;
void OnEnable()
{
TryGetComponent(out m_Confiner);
TryGetComponent(out m_Vcam);
}
void Update()
{
if (m_Confiner != null && m_Vcam != null && !m_Confiner.BoundingShapeIsBaked)
m_Vcam.InternalUpdateCameraState(Vector3.up, 0);
else
enabled = false; // work done, go to sleep
}
}
Resolution Note (3.1.X):
This is expected behaviour.
Confiners can take a few frames to warm up. When CinemachineCameras are activated using Priority and have StandbyUpdate set to RoundRobin, the warming up will occur in the background.
This project, however, enables and disables components to activate the camera. This is fine, but it will prevent the background warming up from occurring.
An easy workaround is to add the following script to the confined cameras (I added it to the CinemachineCamera prefab, and it solved the problem):
using Unity.Cinemachine;
using UnityEngine;
public class WarmUpConfiner : MonoBehaviour
{
private CinemachineConfiner2D m_Confiner;
private CinemachineVirtualCameraBase m_Vcam;
void OnEnable()
{
TryGetComponent(out m_Confiner);
TryGetComponent(out m_Vcam);
}
void Update()
{
if (m_Confiner != null && m_Vcam != null && !m_Confiner.BoundingShapeIsBaked)
m_Vcam.InternalUpdateCameraState(Vector3.up, 0);
else
enabled = false; // work done, go to sleep
}
}