Problems to getName() from a geometry in a collision

Hello, I’m trying to do the tutorial number 8 about picking. The problem is when i try to detach Spatial models. I do detach(result.getGeometry()) but nothing happens or try to do with detach(result.getGeometry().getName()) but is the same result.

Sorry for my bad english I speak spanish.

If you are doing rootNode.detach(result.getGeometry()) it may not work, because the geometry might not be a child of the rootNode. Use result.getGeometry().removeFromParent() instead.

Yes, I can delete geometry from any node. But i have another question: I don’t detach from the rootNode i do detach from the real parent but doesn’t work too. Why?

Thanks for your answer, that fixed my problem.

try result.getGeometry().getParent().removeFromParent()

@svaldenegro said: Yes, I can delete geometry from any node. But i have another question: I don't detach from the rootNode i do detach from the real parent but doesn't work too. Why?

Thanks for your answer, that fixed my problem.

…because it wasn’t the “real parent”. You only thought it was.