# Is there a way to change displays in unity

I was wondering if I could change displays in Unity by hitting a key.

For example,

• I want to look down on the battle, so I hit 1.

• Then I want to see it from the side. I hit 2, etc.

Is that possible to do within Unity, or do I have to do that with a script?

I have 3 cameras set up, each of them outputting to a different display. I want to switch between those cameras/displays to get a different viewing angle for the players. As an example, in the Unity editor, in the upper left corner, you have a tab that says Display 1. Clicking that will show you other displays.

Also, when setting up a camera, you have to connect it to a display. (I know you already know this, I just wanted to make sure you guys knew what I was talking about

• Are your asking about changing the camera angle? What do you imagine would render that impossible? How have you tried writing a script so far that listens for buttons to be pressed and repositions the camera in response? – DMGregory Aug 24 '19 at 11:40
• Presumably you tried using a script to set the targetDisplay field of the camera in question? What did you try so far, and how did the results differ from what you want? – DMGregory Aug 24 '19 at 14:59
• You can do that with the unity addon, "cinemachine" I believe it is now built in with Unity, but if you can't find it, it's free on the asset store. – Millard Aug 25 '19 at 1:05

in unity we have scenes. you have to implement you game in different scenes and change scenes using code below: using UnityEngine; using UnityEngine.SceneManagement;

public class ExampleClass : MonoBehaviour
{
void Start()
{
// Only specifying the sceneName or sceneBuildIndex will load the Scene with the Single mode
}
}


another approach to puth some gameObjects in a scene.then make camera show those scenes. this is my example:

list objList;

Update()
{

if(Input>GetKeyDown(KeyCode.Q))
{
Camera.main.transform.position= new Vector3(objList[0].transform.position.x,
objList[0].transform.position.y,
Camera.main.transform.position.z);
}

}

• It sounds like this could be done with one scene, just moving the camera, or reconfiguring objects in a single scene. – DMGregory Aug 24 '19 at 11:41
• @DMGregory there is lots of possiblities but this is the simplest approach for a beginner – virtouso Aug 24 '19 at 11:45
• I strongly disagree with that statement. At minimum, now we have to set up two scenes instead of just one And persisting game state across scenes is an issue that trips up many Unity beginners. So I would say this proposal is very much not simpler than the alternatives. – DMGregory Aug 24 '19 at 11:48
• @DMGregory ill edit the answer – virtouso Aug 24 '19 at 11:53
• I edited the question to include a few more details, I will add more if asked. @DMGregory – jackson Aug 24 '19 at 12:53