Can anyone help me to understand why my code might not be working? I’m attempting to make a simple door type object that holds a unique string and when the player collides with it the scene with the same name as the string is loaded. Here is the script I have rn. I added a collider to both the door obj and the player yet it does nothing when my player walks over top of it. Additionally, I have Player tagged using the player tag. Any help is appreciated. Also, unity debugging tips also appreciated.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class DoorTraversal : MonoBehaviour
{
//where the door leads to
public string targetScene;
void OnTriggerEnter2D(Collider2D other)
{
if(other.CompareTag(“Player”))
{
SceneManager.LoadScene(targetScene);
}
}
}