- Home /
Help Me with my gun!
When I try to fire a bullet in my game, it says: "UnassignedReferenceException: The variable projectile of 'gunfire' has not been assigned."
Someone previously answered: "You haven't assigned the actual GameObject in the Inspector to the variable projectile."
How would I go about doing that?
@syclamoth I'm sure he is serious. That's what this place is for, asking questions and getting answers. Sarcasm isn't necessary.
Answer by Eli-Davis · Mar 12, 2012 at 02:57 AM
Drag and drop muh good sir, pull up the game object that has your gunfire script in the inspector tab, it should have a list of variables under it, one of which being projectile if I'm right. To the right of that variable it should say empty
Drag your prefab of what ever you want to shoot from your project tab over the text labled "empty". Then drop the prefab into it
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Creating a 'rotation' system 1 Answer
Variables not showing up in inspector 1 Answer
Assigning animations in inspector? 1 Answer