Seems like .Exists is more about render, but not game physics.
Sometimes you don’t need show something to player, but you still need calculate behavior of this thing, for example…
Although the ability to completely hide an object can also be useful.
That’s a bug when it happens (and I think I had experienced something like this before too). Please submit a testcase to reproduce, I want to deal with it.
When Exists = false, the behavior should be equivalent to when the object is not part of the hierarchy (so e.g. MyTransform.Exists:=false is similar to just removing TCastleTransform from the parent like MyTransformParent.Remove(MyTransform), so it’s not present at all in the viewport). So all rendering, animations, collisions (physics) should not affect it.
To only hide the object (but keep the rest working, like collisions) you would indeed only toggle Visible.
I think in this case, from what I understand the original report, the workaround would actually be to check xxx.Exists, not xxx.Visible. But indeed this would be a valid workaround.
Still, it’s something I’d like to fix in CGE, to make it unnecessary to workaround If you have a testcase to reproduce, I should prevent such collisions from being reported at the “engine level”.
Ok, it took a while because initially the testcase doesn’t reproduce the bug, but comparing with the project that failed I found that the only difference is that it fails when I change the Exists property by code. So now I have a testcase that reproduce the bug here.*
Note it is a bit tricky: there’s an explanation in the README.md file.
*If you can’t download the file maybe it’s because I clean it.