I'm trying to make it so when I walk over a box collider 2d and press w i go to a new scene(like walk inside house) but i have no idea how to do that

my script is this for just walking over it, it goes inside the house but, i want it so when you press the key w you go in:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class LoadNewArea : MonoBehaviour {

public string levelToLoad;

// Use this for initialization
void Start () {
	
}

// Update is called once per frame
void Update () {
	
}

void OnTriggerEnter2D(Collider2D other) {

		if (other.gameObject.name == "Shrump")
	{
		SceneManager.LoadScene(levelToLoad); 
		}
}

}

First, go to the set the button that you want to be the trigger in the input manager:

File → Project Settings → Input

There, you have all these various buttons and axis you can use as platform independent controls. So, let’s say you want “A” to be your trigger. You can create a new button called A, have the positive button be any button you wish (could be A, could be space, whatever). From now on, Unity sees that keyboard button as your button A. Then, create some kind of script where you will manage input. I’ll give you an example:

using UnityEngine;

public class ButtonsScript : MonoBehaviour
{
	public LoadNewArea LNA;

	void Start()
	{
		LNA = FindObjectOfType<LoadNewArea>();
	}

	void Update()
	{
		if(LNA.isInRange && Input.GetButton("A"))
		OnButtonA();
	}

	public void OnButtonA ()
	{
		SceneManager.LoadScene(levelToLoad);
	}
}

while your old script would be

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

public class LoadNewArea : MonoBehaviour 
    {
             public string levelToLoad;
    
             void OnTriggerEnter2D(Collider2D other) 
             {
                      if (other.gameObject.name == "Shrump")
                      isInRange = true;
              }
    
             void OnTriggerExit2D(Collider 2D other)
             {
                      if(other.gameObject.name == "Shrump")
                      isInRange = false;
             }

Alternatively, you could do this more elegantly by simply changing your original script to:

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

public class LoadNewArea : MonoBehaviour 
        {
                 public string levelToLoad;
        
                 void OnTriggerStay2D(Collider2D other) 
                 {
                          if (other.gameObject.name == "Shrump" && Input.GetButton("A"))
                          SceneManager.LoadScene(levelToLoad);
                  }
        }

Of course, the second way is much better, but a bit less flexible. Think about if you’re going to need a script managing button presses, and construct it while considering the future of your project.

OMg thanks for answering i was really annoyed that i couldnt figure out what to do cause im like reealllly new to coding