What is the best way for a physicsCharacterNode to pick an item?

what is the best way for a physicsCharacterNode to pick an item?

I tried with physicsCollisionListener, but, when the collision happens, there is a little pause, which interrupts the flow of the game.

I am also facing some invisible physics node’s presence.But, ignoring it, i think its not the best way to go.



So, what is the best way? any idea?

If your object is at a certain distance from your character you can pick him. Like this :

[java]



posP = object.getLocalTranslation();

posN = character.getLocalTranslation();



if(posP.distance(posN) < 5 && posP.angleBetween(posN) == 0;){



if(name.equals("Pick")){



object.pick(character);



}[/java]



It must be false someone with more experienced could give you more information :wink: