I’m trying to make it so when my player gets five points and they collide with the door, the menu screen for my game shows up. I thought this code was fine but the main menu won’t show when I collide with the door. Can anyone help me fix this? Here is my code below:
Im also using unityengine.scenemanagement too. The rest of the code including the points works fine it’s just the loading of the scene that won’t work.
Try checking your scene setup, I can’t immediately spot anything wrong with this code so it’s probably that you’ve forgotten to set a tag somewhere or make your collider a trigger. Don’t forget as well if you build your scene to add the scenes being loaded. You’re using strings as well so remember they’re case sensitive.
Just debug log to see where to look. If the message doesn’t appear it’s potentially a tag or collider issue, if it does appear then most likely you haven’t added the scene to the build index list.