obj.Delete() - originalfoo/Prison-Architect-API GitHub Wiki
Will delete this object.
If the game is paused, the object will still be seen and will be removed when the game continues. However, for script like someOtherObject.GetNearbyObjects(...), this object is already gone.
You may need to add o.Hidden = true before you delete this object for better user experience.