- Home /
Question is off-topic or not relevant
What's Wrong With This Script?
I'm trying to make a strategy game and i'm some scripts from a tutorial, they say that it will make the unit move, but when i click on the unit and click on the ground next to it i just get this message and he doesn't move.
NullReferenceException: Object reference not set to an instance of an object
i won't post them cause they're really long, if you don't know how to fix it by the error, could you please tell me where i can find a tutorial with good scripts?
Honest straight advice? You're starting too big. If you think you can even make a demo without knowing how to script you're wrong. Start small, start by writing scripts. Understand what you write and then move on to another harder code. Just saying...
Answer by Sospitas · Jan 17, 2014 at 01:18 PM
The variable hasn't been set, so either assign it in code, or drag and drop the object onto the relevant field on the script in the inspector.