Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Object reference not set to an instance of an object

Discussion in 'Scripting' started by Benhes132, Jul 7, 2020.

  1. Benhes132

    Benhes132

    Joined:
    Jul 7, 2020
    Posts:
    1
    Hi guys,
    I'm receiving this error in my code and I was wondering if anyone was able to help?
    Unity is saying the error is on line 43 & 37
    Capture2.PNG
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,186
    The only thing I see on line 43 that could be null is rb. And in this case, the reason it is null is because your awake is wrong.

    Caps matter. It should be Awake