So I'm basically creating a simple maze made out of different rooms. There are several doors in each room that all lead to another specific door in another room.
For example, this is the script on the first door of the first room that leads to the first door of the second room:
`public class RoomOneDoorOne : MonoBehaviour {
void OnTriggerEnter2D(Collider2D other) {
Application.LoadLevel("RoomTwo");
DontDestroyOnLoad(other.gameObject);
}`
The problem is that the doors go both way so I need to 'teleport' away from them, just by a little bit. I tried the OnLevelWasLoaded method but then all the doors send me back to the same spawn point (when they should all have a different one...)
I'm rather lost and I don't know that much about unity or coding so any help would be greatly appreciated :)
↧