When in a first person perspective the third person materials are swapped for an invisible shadow castor material. This then allows the separate first person arms object to render without seeing duplicate arms (or the character’s head from getting in the way of the camera). This works well for single player games, but with split screen games or mirrors the material needs to be swapped multiple times so other players don’t see a character without any arms or head.
The Split Screen Camera component will do this material swap allowing for multiple cameras on the same screen.
- Add a camera using the Scene Setup Manager.
- Duplicate that camera. Ensure only one Audio Listener exists within the scene.
- Create a new character using the Character Manager.
- Create a second character using the Character Manager.
- Add the Material Swapper component to the GameObjects that contain the CameraController.
- If you are not using a Scriptable Render Pipeline add the Material Swapper component to the First Person Camera that is a child of the main camera. Your setup should look similar to:
The Material Swapper component exists on the four Camera GameObjects.
- Adjust the Camera’s Viewport Rect so the cameras do not render over each other. In the above scene the left viewport was adjusted so it has a width of 0.5. The right camera has a X value of 0.5 and a width of 0.5.
- On the Camera Controller component set the Character field to the first character, and the second camera’s Character field should be set to the second character.
- The UI needs to know which character it represents. On each UI Monitor assign the character:
Assign the player-specific inputs to the character. The Rewired integration makes it easy to have multiple inputs attached to a single instance.