Previous Cameras Rotation Being Used When Switching

Hello All,

I have two cameras:

Cam A - Rotation (0,0,0)
Cam B - Rotation (0,90,0)

When I switch from Cam A > Cam B the rotation switches to Y-90 correctly.
However, when I switch back from Cam B > Cam A it holds the Y-90 instead of switching back to Y-0.

Is anyone able to please assist? Thanks!

Could you send a couple of screenshots of Cam A’s inspector?

1 Like

Absolutely!

.

Thanks for the reply!

I checked, I could not reproduce this in CM 2.6.11. What version of CM are you using?

Could you send some images of your Hierarchy? Maybe you have the vcams as a children of the Main camera (which is not a good idea, because the Main Camera’s transform is going to affect the children vcam’s transform. In this case, it would affect Cam A’s rotation, because Cam A does not have control over rotation, just the position (Body)).

2 Likes

Yes, definitely! :slight_smile:

Im using Version 2.7.9. None of the cameras are parented to the Main Camera. I just have an empty gameobject to organize them and I made sure the parent remains 0,0,0.

A bit more information- I have a box collider that the player enters to transition Camera B > Camera A. When the player enters the collider from a specific side, it works fine. However, when I enter another side of the collider, it keeps the rotations - Y.90.

Here is my Hierarchy:

It looks like you have Cameras with CM Brains on all your vcams. This is wrong.
There should be a single Unity Camera object with a CM brain.
Next, you should have separate vcam objects, not related to the Unity camera.
It’s the job of the CM Brain to locate the current active vcam in the scene and make the camera track it.
So, delete all those Cameras and CMBrains from the vcams.

2 Likes

Hey, thanks so much for the reply!

Yikes, I’ll remove all the brains outside of the one on the Main Camera. :sweat_smile:

I’m a bit confused by the second half though. When you say “Next, you should have separate vcam objects, not related to the Unity camera.”, would you mine elaborating on this a bit more?

Do you mean having one Main Camera and the rest Virtual Cameras? I believe I’m already doing that unless I am missing something…

Yes, that’s what I mean. I was just emphasizing that they should be separate objects, not parented to each other.

1 Like

Removing the brains resolved the issue! Thanks so much Gregory!! TTvTT

1 Like