Hey all,
I’ve got a prob with cross-language referencing a script of mine. I managed to get it to work on one script, then I try the same way on another pair of codes and it doesn’t work. It says in the debug;
NullReferenceException
UnityEngine.GameObject.GetComponent[ThirdPersonController] ()
CodeInput.OnLevelWasLoaded (Int32 level) (at Assets/CodeInput.cs:70)
here’s where I reference the code;
private GameObject player;
private ThirdPersonController playerController;
if (level == 1)
{
playerController = player.GetComponent<ThirdPersonController>();
This script is in my normal Scripts file, and the playercontroller one that I’m (trying to) reference is in the Plugins folder, so all good there. How come it’s not doing it? I know cross-referencing isn’t an exact science, but help would be much appreciated : )