Scene-loading code

Hi everyone, I come again, for a question.

Firstly, here’s the scene:

I searched the Internet how to do, and unfortunately I have not found any solution for my request. I want when the player approaches an object (example here: the television), an information message and prompt to press a key (E or F). Once the player presses the button, a scene starts.

Thank you very much for reading, and thank in advance those who will help me.

Have a good day.

Use Physics.Raycast

Here’s an example:

	float distance = 3f;
	RaycastHit hitInfo;
	if (Physics.Raycast(Camera.main.transform.position, Camera.main.transform.forward, out hitInfo, distance))
	{
		if (hitInfo.transform.name == "TV")
		{
			Debug.Log("Display your message");
			if (Input.GetKey(KeyCode.E))
			{
				SceneManager.LoadScene(1);
			}
		}
	}