Unity nullreferenceexception. Getcomponent rigidbody unity. main camera unity. main camera transform. if transform.position.y < 0 && !spawner.