Search Unity

I am a noob at unity but when I enter or exit a new scene my game pauses

Discussion in '2D' started by pokemontybor, Jun 12, 2019.

  1. pokemontybor

    pokemontybor

    Joined:
    Jun 11, 2019
    Posts:
    8
    when I enter or exit a new scene my game pauses I dont know why this is happening but here is the code:

    using System.Collections;

    using System.Collections.Generic;

    using UnityEngine;

    using UnityEngine.SceneManagement;





    public class AreaExit : MonoBehaviour

    {





    public string areaToLoad;

    public string areaTransitionName;




    // Start is called before the first frame update

    void Start()

    {



    }



    // Update is called once per frame

    void Update()

    {



    }



    private void OnTriggerEnter2D(Collider2D other)
    {
    if (other.tag == "Player")
    {
    Debug.LogError("Collisiondetected,TryingtoLoad");
    SceneManager.LoadScene(areaToLoad);


    }

    }

    }
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,635
  3. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,807
    Last edited: Jun 12, 2019
    pokemontybor likes this.