Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question I keep getting an error saying I need to reassign an already asigned variable?

Discussion in 'Scripting' started by Relanar_Programming31, Dec 19, 2022.

  1. Relanar_Programming31

    Relanar_Programming31

    Joined:
    Dec 19, 2022
    Posts:
    1
    The variable (Insert variable name here) of (Insert script name) has not been assigned.
    You probably need to assign the (variable name) variable of the (script name) script in the inspector.
    UnityEngine.Transform.get_position () (at <4ac9ef2b8e294691b53b47afb04569b7>:0)
    (script name).Update () (at Assets/Scripts/ScriptName.cs:22)
    Edit: I resolved the problem
     

    Attached Files:

    Last edited: Dec 19, 2022
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,661
    I don't understand your question. It isn't a question. You've taken out all the useful information in the error message with "insert variable name here" nonsense. The error message is telling you what is wrong. If Player is null because you never set it in the Inspector, line 22 would have a problem.

    Maybe English is not your first language, but your bad spelling will get you in trouble. Some of these mistakes are just your variable names so there's no problem. "Verttical" is not a valid axis.