Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug NullReferenceException: Object Reference not set to an instance of an object

Discussion in 'Scripting' started by BrittonKrueger, Apr 26, 2024.

  1. BrittonKrueger


    Mar 27, 2024
    Hello, I'm trying to make a Tower Defense game and my economy system is giving me issues. Currently I have it set to provide money equal damage dealt to enemies, a display for how much money the player has and a cost for placing towers. My issue is when I go to press the button to begin placing a tower i get the error in the Title, which prevents placement. I will include the error, the line it is referencing and other parts of the code that I believe are related. What can I do to fix this? Any help would be much appreciated. 1.png 2.png 3.png 4.png 5.png
  2. Kurt-Dekker


    Mar 16, 2013