I have some code that time slices raycasts, so instead of raycasting immediately a go will ask to be queued for raycasting and then a raycast is performed and the result is sent back to the instance. However when this is used by enemies they can be killed between the time they ask for a raycast and the time the result is sent back, causing a lot of
ERROR:GAMEOBJECT: Instance ‘/instance362’ could not be found when dispatching message ‘ray_cast_response’ sent from game:/map/level#script
While this is not a big issue since the player won’t know it clutters the console immensely and I am in the debug version there is of course a performance hit for writing to the console (though I hope this is not persisted to bundled versions?)
Anyway - to the question: Is there a way to check if an instance exists before attempting to communicate with it?