Null Reference Exceptions

Getting a NRE with this code, which seems pretty simple to me. Claims that the Respawn call is not getting a reference.

    if (Input.GetButtonDown ("Respawn"))
	{
       RespawnManager.Respawn (this.gameObject);
	}

This is a problem I seem to come up against quite often - I simply what to refer to the parent gameObject of the script, and there doesn’t seem to be a easy/consistent way to do this. I can acquire the position of the Parent using gameObject.transform.position, but gameObject gives an NRE. I had hoped that this.gameObject would solve it, but no dice.

I’m at a loss at this point. Going to step away for a bit, check back in tonight.

Answer: I’m an idiot! Found the answer after some more head pounding and totally reassembling a few parts - Punchline: Make sure the script RespawnManager is actually attached to the object you’re attempting to reference.

After all that, the gameObject was not actually the NRE, it was the Script/Function combo.

Oh well.