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

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,192
    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