Cross-language code referencing problem

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 : )

Looks more like your player object is null.

Hmm, let me recheck that…

Yup, that was it. I was identifying the player Gameobject only on another bit of code, thanks for clearing it up : ) :thumbs_up: