Im a bit embarrassed to post for such a little problem, but I can’t find a solution.
I made a control class for boxes. I want the box to detach when a condition is met.
I get the node with a getter, and then do node.detachChild(spatial);
This doesn’t work. If I do node.detachAllChildren(), it works as expected.
I would agree with aegroto, although it could be the wrong node that you’re trying to detach from. For instance if you have rootNode → node → box and you try to do rootNode.detachChild(box) it won’t work, you would need to do rootNode.detachChild(node) or node.detachChild(box). Or you could just do: