Set location Rotation when changing a scene

I’m working on an virtual museum. The user find himself inside a museum hall (scene 1) and then he is able to cross different paintings and then being redirected to a different scene in each painting. My question is how can i set the position and the rotation of the player when he comes back to the main hall so he would be next to the painting he entered and not from the beginning?
I saw Dontdestroyonload functions and static functions, but i dont know what’s best to use.

Thank you for helping a helpless girl !

[EDIT]
The easiest way to perform this is to use a static variable. A static variable will be global to your whole project and not your current scene. The solution you are looking for is very easy to implement, but there are several things to do.

First : the MainHall scene. You have 3D paintings in it, these 3D paintings are gameobject put in your scene. Into these gameobject, put a child gameObject called “Spawn”, and place the “Spawn” at the position and rotation you want for this specific painting. Then, you should have a script like this on your painting object :

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

// Represents the painting
public class PaintingSelector : MonoBehaviour 
{
	// This is the Spawn object inside the painting object
	public Transform spawn;

	void Start()
	{
		// At start, set the spawn transform by looking in painting's children
		spawn = transform.FindChild ("Spawn");
	}

	void OnMouseDown()
	{
		// When you select the painting, set the statics then load the next scene
		Statics.firstPlayerPosition = spawn.position;
		Statics.firstPlayerRotation = spawn.eulerAngles;
		SceneManager.LoadScene ("PaintingScene");
	}
}

Now, your Statics file. It constains the position and rotation you want to keep between the two scenes:

using UnityEngine;
using System.Collections;

public class Statics
{
	// This is used for the very first time you enter the MainHall, there is no seen painting at this moment
	public static bool firstTimeInHallPassed = false;

	// Position and rotation of the player next time you enter the MainHall
	public static Vector3 firstPlayerPosition = Vector3.zero;
	public static Vector3 firstPlayerRotation = Vector3.zero;
}

And now, the player. When the scene MainHall starts, you want to put the player at the position defined by your Statics, but only if you are coming from a PaintingScene, not the first time you play the game :

using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour 
{
	void Start () 
	{
		if (Statics.firstTimeInHallPassed) 
		{
			transform.position = Statics.firstPlayerPosition;
			transform.eulerAngles = Statics.firstPlayerRotation;
		} 
		else 
		{
			Statics.firstTimeInHallPassed = true;
		}
	}
}

As your problem is like making a complete project with several scripts involed, I made a little Unity project to be sure that my solution is working. So I can tell you : it’s working.
So if you have a problem and it’s not working for you, it means that you have done a little mistake somewhere and I can help you to find it.

You could save the players location and rotation when they go into another scene and then set it when they exit

Hi,
the easiest will be to just save the position and rotation to playerPrefs before you leave the main hall and then load them back when you come back to the main hall.
Something like this:

 //in scene 1 on a save button
 public Transform player;
     
 void Save ()
 {
 PlayerPrefs.SetFloat("PositionX", player.position.x);
 PlayerPrefs.SetFloat("PositionY", player.position.y);
 PlayerPrefs.SetFloat("PositionZ", player.position.z);
//repeat similar for rotation
 }

 void Load ()
 {
 player.position = new Vector3(PlayerPrefs.GetFloat("PositionX"),PlayerPrefs.GetFloat("PositionY"),PlayerPrefs.GetFloat("PositionZ"));
 //repeat similar for rotation
 }

then you can run save script before you leave your scene and run load on the Start() when you come back to your main hall scene. - or just put the whole load code in start and no need to call it.
hope that helps,