It was a little confusing, but I think I understand. is_instance_valid()
did not go away (you can see it is still in the latest docs for 4.0) but it appears there was a memory bug in previous versions (but it was fixed around 2020, so should not be an issue today).
From what I can understand, is_instance_valid()
checks a memory address (pointer) for an object id. However there are edge cases where an object can be destroyed, but a new totally different object is create at the same memory address. While the object ids are different, it is still a valid instance of an object (just a different object than the original) meaning is_instance_valid()
returns true, in error.
To make things worse, there are additional checks for validity in debug mode (which is normal, that is why it is debug mode) but not in release. Meaning when testing your game it would work (you would never see the memory address bug) but after building your game it could happen (but it's still a rare edge case, you may not notice). So this is pretty bad. But it doesn't matter, since they fixed it 2 years ago.