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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
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
}
}