Hi, I’m new to Unity and I’m trying to follow the FPS Tutorial. I completed the first part fine. The second is causing me some problems now.
I have created the rocket launcher and the rocket prefab, and have come to page 6 of the tutorial, but here it goes wrong. When I try to fire a rocket, I get the error:
NullReferenceException: The prefab you want to instantiate is null.
The attached image shows which part of the code the error refers to (in RocketLauncher.js).
Now, the tutorial says: [TODO , hook up the rocket to the rocketlauncher variable].
What I have done is to drag the rocket prefab I created onto the projectile variable in the rocket launcher script (again, see attached image). Is that not what I’m supposed to? Why does the error say that the prefab is null then, and how am I supposed to correct it?
Another error I have gotten is:
Assets/WeaponScripts/FPSPlayer.js(124) error BC0019: ‘frame’ is not a member of ‘UnityEngine.Texture2D’.
This is not a big problem yet, as I’m not using that script, but it’s strange that it generates an error when it’s part of the FPS asset pack.
Thanks in advance,
Rune
