Is there a way to silence errors about an instance not existing?


I have setup some spawning logic and in-game there are no issues with it. However, if the spawner is destroyed prior to all spawned entities being destroyed, when they attempt to notify the spawner on death that they no longer exist, they are sending the message to a nil reference. I know I could fix this by simply maintaining a table of spawned entities within the spawner. However, then I need to constantly update a lua table w/ each spawn and death event. This seems non-performant since the only time it matters is when it’s already gone. It would be much more elegant to simply be able to attempt to send these messages and if the spawner doesn’t exist, to simply ignore them.

For one of the maps I’m working on, I can play through the area without any gameplay issues whatsoever. However, in the console, I am seeing over 2,000 errors. Is there any way to simply disable the error output for a build? I don’t want to clutter the adb log with a bunch of nonsensical errors that don’t actually crash the game or affect the gameplay in the first place.



The reasoning is that sending a message to something that doesn’t is an error and should be logged as such.

You could move this tracking logic to a separate Lua module and have an extra check in there instead.

1 Like