Im working with jMonkeySDK on a 3D java game. When I shoot a model/spatial with a ray it returns that spatial. So I can access things like
.getName() or .setUserData().
The Spatial as physics on it. So when the game starts it falls down from the sky. So for the beginning I want to implement a pickUp method that sets the local translation of that spatial to a certain point.
.getParent().setLocalTranslation(0, 50, 0);
(parent is "Blender Exports/woodlog/woodlog-scene_node (Node)" <- my Spatial)
(0, 50, 0) Is up in the air again. So it should fall down again. But this won't work! I can print out the translation afterwards and I get these coordinates. But the spatial does not move. So I got the parent of this parent
.getParent().getParent().setLocalTranslation(0, 50, 0);
That set the translation somehow, but the spatial moves wierd around than. First it goes to the correct point (0, 50, 0) But then it goes left, right, left, right. Then it stops and stays in the air.
Ho do I get this fixed? Why happens these wierd "animation"? And why does the mass dissappear. Well, I dont know if it disappears but the spatial should fall down again right?