Question about node position


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(..))
child.getLocalTranslation().x = ...;
// etc.

Hi llama!

I do this:

NoPlayers noP = new NoPlayers(/*"c:/CONVERSOES/aff2.jme"*/
      noPlayerNode.getChild(0).setLocalTranslation(new Vector3f(-20, 3, -20));
      NoPlayers noP2 = new NoPlayers(/*"c:/CONVERSOES/aff2.jme"*/
      noPlayerNode.getChild(1).setLocalTranslation(new Vector3f(50, 3, -20));      

target -> noPlayer

               Vector2f screenPos = new Vector2f(MouseManager.get().getHotSpotPosition().x, MouseManager.get().getHotSpotPosition().y);


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: