is there a way to teleport the player to a certain coordinate right after loading a scene?
so I've been working on a 2D exploring simulator, and I was wondering if there's a way for me to teleport the player to a certain place on the map after using a certain script.
I have the basics of changing the scenes, but there's 2 entries and exits to it, when I use the first entry, it teleports the player to the spot I want to (which is the default starting place for the player). but if I use the other entryway, it also teleports the player to the same (default) starting place, which I do not want.
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;
public class toptocastle : MonoBehaviour { public string eggcastle;
void OnTriggerExit2D(Collider2D collision)
{
SceneManager.LoadScene(eggcastle, LoadSceneMode.Single);
}
}
is there something I could edit to this script to add a certain coordinate to teleport the player to said coordinate, or should I have to redo the whole script?
thanks in advance!