Search Issue Tracker
By Design
Votes
0
Found in [Package]
2.6.1
Issue ID
1268001
Regression
No
Main Camera's transform.position does not get updated when using Virtual Camera
How to reproduce:
1. Open the attached "CameraPositionIssue" project
2. Open Scenes/SampleScene
3. Open Main Camera's Inspector window and lock it
4. Enter Play Mode
5. Move the Capsule Game Object in Scene View
6. Observe the Console window
Expected result: the camera gets stuck in (0,0,0) position, the console prints camera's POST transform.position as (0,0,0)
Actual result: the camera moves and tracks the capsule, but the console prints the camera's POST transform.position as (0,0,0)
Reproducible with: 2.2.9, 2.3.4, 2.6.0, 2.6.1 (2018.4.26f1, 2019.4.8f1, 2020.1.3f1, 2020.2.0a20)
Note:
- In the script, I'm setting the camera's position to (0,0,0) in the Update() method, expecting to see it stay at that position in the editor, but it does not, the camera moves and follows the capsule. After setting the camera's position, I try to retrieve it by using Camera.position and it returns (0,0,0), although it is not.
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
- Asset Database warning is being logged continuously when creating a script in an embedded package
- Build process only shows Initializing when building for Android
- TileMap Palette preview flickers when scaled
- Shader Graph Blackboard "plus" sign is not centered within the button
- [URP] When Rendering Layers are enabled, the DepthNormalPrepass is enabled even if not used
Resolution Note:
By Design. Main Camera transform is updated correctly by Cinemachine (in LateUpdate), when the Capsule is moved around in the scene. Cinemachine is setup to track the capsule, therefore changes to the Main Camera's transform are overwritten by Cinemachine.