How to detach n number of objects?

i had a made an firing game in which the bullets have to detached they become stationary how to do this??
eg:- rootNode.attachChild(bullet);
//on each call of a button click it gets attached and we need to remove it after they become static.

This will teach you that (except the stationary detection):

Stationary tracking:

u mean 2 say that i make a parent node in which many bullets are attached then i detach them!

I think you’d be better off having a pool of bullets and instead of detaching them, making them not be rendered until you need them again (facecull.frontAndBack or something).

Just keep track of your bullets… You’re thinking backwards, don’t expect the library to do things your software is supposed to do.

i didnt get u!!

The answer to your actual question is (note this is pseudo code)


But your question probably more aims at getting info on how to actually get “bullet” in some part of your code. You seem to expect the library (that is jME) to do that in a way like rootNode.getAllBullets() but that is something that YOUR code has to provide. So simply keep a list of all bullets you add to the scene.

And by the way - to simulate bullets don’t use physical objects and actual spatials - just don’t.