Branchgroup RemoveChild

Hello, New in here ;D

I’m getting this exception every time I try to remove a child from my Branchgroup objRoot.

Exception occurred during Behavior execution:
javax.media.j3d.RestrictedAccessException: Group: only a BranchGroup node may be
removed

I simply tell it objRoot.removeChild(blah); It compiles perfectly but then I get that, am I missing something here :-/

and yes I have done the ALLOW_DETACH

it’s long ago i touched j3d, but i think the ALLOW_CHILDREN_WRITE bit should be used if you want to remove some child. Whereas ALLOW_DETACH is used to detach oneself. …I may be wrong.

The capability ALLOW_DETACH is only available in branchgroup. Drop children only if ALLOW_CHILDREN_WRITE is set. Then set it to null in the branchgroup.
If you want a detachable leaf hang it off a branchgroup which can be detached.