Adds the destroyed flag to gameobject.