First Person, holding an object

I would like the effect of holding an item in a first person game.



I am unsure if I achieve this effect by attaching a node to the camera, or using nifty gui in some way.



Ideally once I able to hold an object in first person, I would be able to animate it (ie. swing a sword) etc.



Is there a tutorial or JmeTest that would point me in the right direction?



Thanks.

Depending on your approach you would most likely have a spatial in the 3d world.

If you’re not using an object with an animated skeleton for your player, you could try a combination of move() and rotate() on you sword to animate it.

I haven’t used it myself, but MotionPath seems to be a good candidate for you as well, see TestMotionPath.java in Test/animation

Also deactivate the depth buffer check for the model, so that the sword is always in front of the camera, instead of half in the wall you are near at. (Where it really is located)