Hello. I'm playing around in Unity3D 3. I'm rewriting this JS code:
But I always get a "NullReferenceException: Object reference not set to an instance of an object" when I hit my Fire1 button. I think there is a variable type problem, but I cant solve it :( Please help. Thanks, Erhan
Here's a literal translation of the first script:
For help with translation, this is a useful link.
Your problem is in one of these possible locations:
You can add some checks to avoid this problem altogether:
answered Oct 28 '10 at 03:15 PM