OPERATION: Find The Error

It took me 4 hours in checking what’s wrong with my game but I can’t find my mistake. I get an error saying:

NullReferenceException: Object reference not set to an instance of an object
EnemyPathing.Move () (at Assets/Scripts/EnemyPathing.cs:28)
EnemyPathing.Update () (at Assets/Scripts/EnemyPathing.cs:23)

As a student learning how to do this scripting kind of stuff, I don’t have an idea of what the heaven does the error means. Can someone explain what’s going on?

Here’s the zip file of my project:
https://drive.google.com/file/d/1omFfwHl_gVVchmY-JWEcOyp-0hxUtKav/view?usp=sharing

I think it’s better if someone can/could (I suck on English grammar you know :laughing:) tell my mistakes in this project and correct me if I’m wrong.

P.S: I’m using Unity v.2018.3.3.1
P.P.S: I skipped the “Create List of Waypoints” and “Move Enemy on Path” portion of the tutorial. My problem has something to do with “Prefabs”. It seems that prefabs works different in Unity v.2018.3 so I guess I’ll study prefabs in Unity v.2018.3 first before diving in. But I’ve seen a lot of people in the community skipping these two tutorials above 'cuz they say that the solution to my problem is in the “For-each loop” section.

This is my first time to post a thread here in the community. I hope someone can solve my problem and I hope my grammar don’t suck.

Hi Matthew,

NullReferenceException means that a reference (“link”) to an instance is missing. Double click on the error message. Which line in your code gets highlighted?

Could you share the relevant code, please?


See also:

I appreciate your response but I’ve already solve my problem before you could even reply to my post. I made a new Laser Defender project again, but this time I did the project at Unity 2018.2 so I wouldn’t have a problem when it comes to dragging a “prefabs” to prefab.

By the way, your reply proves to me that the community is actually a “supportive” place for future “indie” developer like me. I thought Sir. Rick’s statement to the recent tutorial is somewhat a “scam”. HAHAHA!:joy:

Thank you very much and have a good day!:heart_eyes::kissing_heart::smiling_face_with_three_hearts:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms