Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

I have clearly assigned the variable in the inspector and it works but getting thousands of errors

Discussion in 'Scripting' started by JDVDeisgn, Apr 15, 2016.

Thread Status:
Not open for further replies.
  1. JDVDeisgn

    JDVDeisgn

    Joined:
    Oct 17, 2015
    Posts:
    148
    "unassigned reference exception: the variable arrow of player1 has not been assigned, you probably need to assign the arrow variable of the player1 script in the inspector"

    I clearly have, it's assigned as I can see in the inspector and the coding for it works, however, within 5 seconds of gameplay I'm getting thousands of these error messages. this must be just another of the endless amount of bugs I frequently encounter
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,181
    You probably have another instance of the player1 script in your scene that's throwing the error.

    If you search for "t:player1" in the search bar on top of the hierarchy, you'll see all of the gameobjects with that script on it.
     
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,181
    God damn smileys.

    that's supposed to be "t: player", without the space.
     
    ThermalFusion likes this.
  4. Mr_Potato342

    Mr_Potato342

    Joined:
    Oct 1, 2022
    Posts:
    1
    WOAH, u probably even quit unity by now but that helped me, I saw I had 2 instances of the exact same object, I was also wondering why another one of my scripts is not working, this helped me a lot TYSM
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,365
    Necroing this 7 year old thread isn't helping anyone. If you want to show appreciation then please simply hit the Like button.

    Thanks.
     
Thread Status:
Not open for further replies.