- Home /
How do I reassign a variable?
in the space shooter tutorial, on the creating/shooting shots video. Everytime I run the game and try to shoot a laser, it just pauses the game and gives me this error: "MissingReferenceConception; The variable shot of PlayerController doesn't exist anymore." I clicked on it and it took me to one specific line in the PlayerController code, which was: "Instantiate(shot, shotSpawn.position, shotSpawn.rotation);" It suggests reassigning the shot variable, but I don't know how to really do that so...
Answer by Vandarthul · May 20, 2017 at 09:19 AM
shot is a GameObject, probably a public one, so you could assign it in the inspector on which gameobject you put this script on. You should put a prefab on shot variable so it can instantiate it from the source.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
BurgZergArcade Unity tutorial 19-20 errors. 0 Answers
Issues with C# script (using tutorial) 1 Answer
How to add a tutorial to the game? 2 Answers