I cant figure this out. For example, I enter to a portal, how will I make my character to be on the next scene?
Make your portal a trigger. Then, on the portal gameObject, put a script that goes like this:
void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Player")
{
DontDestroyOnLoad(other.gameObject);
Application.LoadLevel("Next Level");
}
}
Of course, your character will remain in the same spot as the portal, so you might need something like this on the character script, as well:
void OnLevelWasLoaded(int thisLevel)
{
transform.position = GameObject.FindWithTag("SpawnPoint").transform.position;
}
This will teleport the player to an object tagged ‘SpawnPoint’ as soon as the level is loaded.