i’m trying to set something up so that when the player collides with the box it moves to the next level but for some reason the player just goes through the box and nothing happens, i even tried making other things happen when the collision occures like debug.log but still nothing happens.
heres the code i have ATM. please note that index is replaced with the index number for the scene in the build manager
using UnityEngine.SceneManagement;
public class LevelChange : MonoBehaviour
{
public int index;
void onTriggerEnter2D(Collider2D other) {
if(other.CompareTag("Player")) {
SceneManager.LoadScene(index);
}
}
}