Upgraded to 3.5 and I’d crash every time I shot a bullet. Finally narrowed it down to my script that manages my shotgun shell game object pool. Line 13 is the problem:
using System.Collections.Generic;
//array of objects
public List<GameObject> pooledObjects;
//we're taking the first object in the list, moving it to the end, activating if necessary
public GameObject GiveObject(){
GameObject pooledObject = pooledObjects[0];
pooledObjects.RemoveAt(0);
pooledObjects.Add(pooledObject);
if(pooledObject.active == false){
pooledObject.transform.parent = null;
//pooledObject.SetActiveRecursively(true);
}
pooledObject.SendMessage("Reset");
return pooledObject;
}
Commenting out “pooledObject.SetActiveRecursively(true);” fixes the crash EXC_BAD_ACCESS I was experiencing.
So to clarify, I had it running without any crashes. I attempt to move over the problem logic from the pool manager to the shotgun shell script itself. Compile, run… now it crashes while it’s starting up. My hunch is that on recompile, something got messed up with an entirely different script and I’ll have to hunt it down again.
Is MonoDevelop’s debugger supposed to work with 3.5? I don’t want to manually hunt down the line causing a problem again. The last one was easier because it only happened when I fired the weapon – I don’t even get past the loading screen now and I didn’t change any startup code from when I had a non-crashing build…