- Home /
How to assign variable aim for headlookcontroller
I'm making a game for a personal project at school, and i have everything done, terrain, soldier, enemies, etc. But everytime i try to start the game it says: UnassignedReferenceException: The variable targetTransform of 'HeadLookController' has not been assigned. You probably need to assign the targetTransform variable of the HeadLookController script in the inspector. UnityEngine.Transform.get_position () (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/UnityEngineTransform.cs:26) HeadLookController.LateUpdate () (at Assets/Scripts/soldier/HeadLookController.js:79) I need help, what to do!!!! btw- im kinda new to unity so yeh :P
Answer by EncryptedCow · Apr 21, 2013 at 03:03 PM
That means exactly what the error says. Click the script or the object it's attached to in the hierarchy, go to the inspector and find the component for the script. Look for the variable targetTransform (None) and click the dotted circle beside it. Then select the object it should reference and it should work.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Variable Question. [Simple] & [JS] 1 Answer
GUI.DrawTexture Error & Static Variables!! 2 Answers
Coding equivalent of Draging an Object into the Inspector (Solved) 1 Answer
Aiming, Camera Orbit 0 Answers