Detaching Geometry

I am trying to detach an object from a Node.



[java]Main.shoot.detachChildNamed(Main.controls.results.getCollision(0).getGeometry().getName());[/java]



When I try print out the name after it is detached, I get -1 back. However, the object still appears in the scene. This object has a RigidBodyControl and a GhostControl attached - should I remove them before?

What do you mean by “appear”? Yes, as you added the objects to the physics space you have to remove them too. Disabling (not removing) the control will also remove it from the physicsspace and also allow to add it again later w/o referencing a physicsspace.

The object still shows up as if it is still attached.

You mean you can see it? Then its not detached.

Could be. However, even using the following, the geometry is not detached:



[java]

shoot.detachChildNamed("Marker");

shoot.detachChild(setup.marker);[/java]

Never mind. Problem solved. Mixed the nodes -.- Thanks anyways.