Hai am new to unity. I wanted to try out my game. It is working fine withing the Unity engine but once i completed the built (PC and Mac standalone) and tried playing with the exe file, most of the features aren’t working! like, the game shud be over when the player touches with the collider but it didnt work. But they are still fine in unity. i think there’s something wrong with my script but im really confuse how to fix it… please teach me how to fix it
i get this error below in the output_log:
NullReferenceException: Object reference not set to an instance of an object
at menuscript.Start () [0x00000] in :0
you have an error in “menuscript” somewhere in the start function… look there (or if you want help with that, post your code from that script here in [ code][ /code] tags)
What you posted just now is not readable. And people are (rightfully) skeptical of downloading random files off the internet, although the paranoia about that on this forum is a bit extreme.
You’re getting the components from themselves. That makes no sense. If you have assigned quitMenu, startText and exitText in the inspector, those calls are all doing nothing. If you haven’t assigned them in the menu, those calls will throw exceptions. What are you trying to do?
The tutorial’s Start code is absurd - as I said, it either does nothing, or crashes. The only line there that makes sense is the last one, which deactivates the quit menu.
The code’s also what’s causing the exceptions that’s crashing your game, because you haven’t assigned either quitMenu, startText or exitText in the inspector.
after deleting those 3 lines which u mention the output log show these errors:
NullReferenceException: Object reference not set to an instance of an object
at menuscript.Start () [0x00000] in :0
UnityException: GameObject has undefined tag!
at (wrapper managed-to-native) UnityEngine.GameObject:get_tag ()
at playerController.OnCollisionEnter2D (UnityEngine.Collision2D coll) [0x00000] in :0
(Filename: Line: -1)
and in the unity it show these errors:
UnassignedReferenceException: The variable quitMenu of menuscript has not been assigned.
You probably need to assign the quitMenu variable of the menuscript script in the inspector.
menuscript.Start () (at Assets/TapNJump/Scripts/menuscript.cs:17)
im really sorry if i burden u much…but im really new with unity and ur help is really important to me
As I’ve already said, you haven’t assigned the quit menu in the inspector.
I urge you to go through some of the official, easier tutorials in the Lean section (check on the top of the web page!). They’re pretty good, gets you started on Unity, and is written by somebody competent. We can help you, but your problems here are very basic, and you’ll be saving yourself a lot of waiting for answers if you spend more time on those tutorials.