I recently upgraded my 2.6 project to 3.0, and now I am receiving the following messages when playing an animation on one of my models. The animation was created in 2.6 using the Animation View. Does anyone know what could be causing this, and if so, how to fix it? I’d rather not delete the animation and recreate it - its for a spider, and it was tedious enough the first time!
I’ve filed a bug report and attached a package that will reproduce the issue. It doesn’t have anything to do with animations as I originally suspected. Rather, it is related to Destroy() called on Colliders that have Rigidbodies attached as well as OnCollision handlers. If I comment all of the OnCollision handlers out, the error goes away; but with just one handler active, the error presents itself.
My goal is to just have the enemies become transparent to physics upon death, so I was cycling through the child colliders and calling Destroy() on each one. I’ll try just turning isTrigger on to see if I that gives me what I want, or perhaps moving the object to a specialized “collide with nothing” layer will do the trick.
I have the same problem here. I always get the assert message when I destroy a collider. And I also use it for making my character immune to collisions when a level has been completed.
Since upgrading from 2.6 to 3.0, I’ve had some troubles with imported animations crashing or imported scenes having corrupt gameObjects once. Some other crashes occurred which I thought were linked to this, but it seems it’s the pair.actors[0] error that’s the culprit, because 50% of the time my game crashes, not always. It happens when the log wants to display the error (at the bottom of the screen). I tried commenting Destroy(collider) and it didn’t crash anymore! If I can’t destroy colliders anymore I’ll have to modify a big chunk of code since I heavily rely on this for my game to work.
Hey guys, why not make use of Unity 3’s new layer-based collision detection? Just create a custom layer that doesn’t collide with anything. Instead of destroying the collider creating the error, change its layer to the custom one you just created. The error won’t appear and your game should run more smoothly if you make the right matches between the layers you want to collide. At first I was using tags to detect collisions with specific objects, but with the new layer-based collision system it was easier to set up which collisions are allowed and my game runs much more smoother.
The workaround I’m using is to just set isTrigger to true. Not the best solution but it will stop the collider from interfering with other objects and won’t cause an error.