Third Person Controller Problem

Hi everyone. I’ve got a problem where whenever I try and use the third person controller with my character, it comes up with this in the console:

NullReferenceException
UnityEngine.Component.get_transform () (at C:/BuildAgent/work/7535de4ca26c26ac/Runtime/ExportGenerated/Editor/UnityEngineComponent.cs:21)
ThirdPersonController.UpdateSmoothedMovementDirection () (at Assets/Scripts/ThirdPersonController.js:129)
ThirdPersonController.Update () (at Assets/Scripts/ThirdPersonController.js:302)

What’s happening here and how could I fix it?

1 Answer

1

Worked it out myself. I hadn’t tagged the camera with MainCamera. This was causing the error.