Scene freeze when using "portal"
using unity 2d for first time following a tutorial by epitome, tried writing everything exactly as he has and everything was going swimmingly till i got to the "portal" part. when i go to swap scenes to "Dungeon1" in play mode the scene changes to "Dungeon1" but my character is no where in sight and I can't control him so i know he doesnt exist below the level or anything. i don't even know where i should start with debugging this I'm going to try and remake the dungeon to see if I messed up the layers or something but i really don't think i did. Here's my code for the
using UnityEngine;
using UnityEngine.SceneManagement;
public class Portal : Collidable
{
protected override void OnCollide(Collider2D coll)
{
if(coll.name == "Player")
{
SceneManager.UnloadSceneAsync("Main");
//Teleport the player
SceneManager.LoadScene("Dungeon1");
}
}
}
The line with UnloadSceneAsync("main") is a bit of an experiment i tried when reading a different thread... didn't change anything for me though. please help. I want to learn more about c# and unity in general but i'm trapped here and have been for several days.
Answer by Mfun1 · Aug 19, 2021 at 09:35 PM
I figured it out. Forgot to put the player and my main camera setup on my new scene.
Your answer