Using multiple cameras with character controller

Hello,

I’m using a Character Controller to drive a camera through a stage, using an XBox gamepad. This works great. Next, I would like to allow the user to switch between controlling and viewing different cameras in the scene. Imagine they want to see a wide view of a digital twin, then jump to a close-up on a particular process.

I’ve attempted to do this with a CharacterController per camera, and switching active cameras dynamically with gamepad input. This works, with one critical caveat: both cameras always move.

I’ve attempted programmatically disabling the CCT on the “inactive” camera, disabling first person control, but neither of these allowed me to only control one camera at a time.

Any advice or ideas on how to best implement such a feature would be massively helpful. Thank you!

I was able to figure out how to control two cameras separately, however upon switching cameras, the orientation seems to reset. I would like the cameras to maintain their orientation, until they are active and moved again.

Any advice or tips on how to accomplish this would be greatly appreciated!

I saw this snippet in the CharacterControllerDemo, and wondered if it would be a way to reset the camera orientation.

# reset camera pos and view
        customLayerData = {
            "cameraSettings": {
                "Perspective": {"position": Gf.Vec3d(2407, 2407, 2638), "radius": 500, "target": Gf.Vec3d(0, 0, 0)},
                "boundCamera": "/OmniverseKit_Persp",
            }
        }
        stage.GetRootLayer().customLayerData = customLayerData