I'm having trouble with object collision in real time combat. I have an enemy that shoots projectiles. If I set the damage dealer on the projectile to destroy on collision it is immediately destroyed and gives me the error:
MissingReferenceException: The object of type 'GameObject' has been destroyed but you
are still trying to access it.
Your script should either check if it is null or you should
not destroy the object.
I've tried setting the z offset of the projectile so I could make sure it wasn't colliding with the enemy that shoots it and it didn't make any difference. I tried all sorts of different combinations of settings for the damage dealer component and nothing makes a difference, except turning off on collision.
Similarly I had an object with an event attached that was set to start on trigger enter and start by other and the event just starts as soon as the object is spawned.This is also causes the problem of enemies being able to shoot through walls. My suspicion is that objects are somehow colliding with themselves.If I turn off the collider then it travels normally, but can't affect anything.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!