make a Tower Defense Game, NullReferenceException

Updated on March 19, 2019 in [A] Tutorials
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
1 on January 26, 2017

Hi I m on the “How to make a Tower Defense Game (E08 SHOP) – Unity Tutorial” and at about 20:00 when I try the game and go over the nodes to place a turret I get this error for each one I go over:

– NullReferenceException: Object reference not set to an instance of an object
Node.OnMouseEnter () (at Assets/Script/Node.cs:41)
UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32)

-NullReferenceException: Object reference not set to an instance of an object
Node.OnMouseDown () (at Assets/Script/Node.cs:25)
UnityEngine.SendMouseEvents:DoSendMouseEvents(Int32)

it doesn’t change color when and I cant place a turret even thought it tells me “Another Turret purchased!”.
it seems like it has to do something with this line:

–  if (buildManager.GetTurretToBuild() == null)
return;

  • Liked by
  • Visual
  • Alex0001
Reply
0 on March 19, 2019

Same Here I have been trying for hours to fix it but no luck

  • Liked by
Reply
Cancel