Question about node position

Hi!



I guess that my problem is simple. I have a noPlayer(Node) and I put some childs(TriMesh) into this node and I set the postion of childs. But when some action occour(atack of my character, for instance), the childs return to position of noPlayer…Have a way to make the childs stay in yourself position?



Thx a lot people!!!

If you want to give your childeren a location relative to their parents, use



child.setLocalTranslation(new Vector3f(..))
//or
child.getLocalTranslation().x = ...;
// etc.

Hi llama!



I do this:


NoPlayers noP = new NoPlayers(/*"c:/CONVERSOES/aff2.jme"*/
                           getClass().getResource("/data/char/noPlayers/aff2.jme"));
      noPlayerNode.attachChild(noP.getTri());
      noPlayerNode.getChild(0).setLocalTranslation(new Vector3f(-20, 3, -20));
            
      NoPlayers noP2 = new NoPlayers(/*"c:/CONVERSOES/aff2.jme"*/
            getClass().getResource("/data/char/noPlayers/aff2.jme"));
      noPlayerNode.attachChild(noP2.getTri());
      noPlayerNode.getChild(1).setLocalTranslation(new Vector3f(50, 3, -20));      
      rootNode.attachChild(noPlayerNode);



target -> noPlayer


if(MouseInput.get().isButtonDown(1)){
               Vector2f screenPos = new Vector2f(MouseManager.get().getHotSpotPosition().x, MouseManager.get().getHotSpotPosition().y);
      

Sorry!!!



I solve the problem…I dont know of this…but I change this line:

loc = target.getChild(i).getLocalTranslation() to loc = target.getChild(i).getWorldTranslation()



and now its working…



Thx llama…and sorry for this… :smiley: