Hi All,
Isololated problem to GetComponent returning nulls. Pulled code fragment from production and made a test case:
// Use this for initialization
void Start () {
FishModel.Type fishType = FishModel.Type.SUNFISH;
GameObject fishGO = FishModel.createFish( fishType, lake, turnManager );
FishModel fish = fishGO.GetComponent<FishModel>();
FishModel fish2 = fishGO.GetComponentInChildren<FishModel>();
FishModel fish3 = (FishModel) fishGO.GetComponent( "FishModel" );
BoatSensors sensor = fishGO.GetComponent<BoatSensors>();
Counter counter = fishGO.GetComponent<Counter>();
}
All the fish give error “Object reference not set to an instance of an object”
Other components return correctly![alt text][1].
One test run, all the fish components were correct?
The fish prefab has not been touched in months.
We say the FishModel script is there and enabled.
We need a second pair of eyes to see what we are overlooking.
Cheers