Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

title screen

Discussion in 'Getting Started' started by SkyGamingDev, Aug 25, 2019.

  1. SkyGamingDev

    SkyGamingDev

    Joined:
    Aug 25, 2019
    Posts:
    1
    i was trying to make a title screen for my game and was wondering how to make buttons switch to the camera that is on the main scene for the start of the game?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,191
    Your question is a little unclear. You don't "switch to a camera" but you do switch scenes. In that case you just need to have a little script with a public method that calls SceneManager.LoadScene, and then invoke that from the button click event.
     
    Joe-Censored likes this.
  3. A_Person_Named_Dart

    A_Person_Named_Dart

    Joined:
    Apr 14, 2018
    Posts:
    330
    If you want to make buttons switch to the camera on the main scene when it is loaded, you could try dont destryonload or just set them as prefabs and set them up when the scene is started
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,511
    To answer the question literally, you'd have a button and in its OnClick you'd call a method you write yourself. In that method you disable the active camera, and enable the main scene camera. You get references to the cameras at some point prior to displaying the button, likely through inspector references.

    But most likely JoeStrout's answer is the better one, since you probably meant how do you load the main scene instead of mess with the cameras.