I have a method addObject
[java]
void addObject(float x, float y, float z, Vector3f translation)
{
box.add( new Box(new Vector3f(-x/2,-y/2,-z/2),new Vector3f(x/2, y/2, z/2)));
int size = box.size() -1;
boxGeom.add( new Geometry("Box", box.get(size)));
boxMat.add( new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md"));
boxMat.get(size).setFloat("Shininess", 8);
boxMat.get(size).setBoolean("UseMaterialColors", true);
boxMat.get(size).setColor("Ambient", ColorRGBA.Blue); // ... color of this object
boxMat.get(size).setColor("Diffuse", ColorRGBA.White); // ... color of light being reflected
boxGeom.get(size).setMaterial(boxMat.get(size));
boxGeom.get(size).setLocalTranslation(x/2, -y/2, 0);
boxGeom.get(size).setLocalTranslation(translation);
// shape.add(new MeshCollisionShape(boxGeom.get(size).getMesh()));
// control.add(new RigidBodyControl(0));
//
// boxGeom.get(size).addControl(control.get(size));
// main.state.getPhysicsSpace().add(control.get(size));
this.attachChild(boxGeom.get(size));
}
[/java]
And with this line I make a new object and add it to the envirenment [java] env.addObject(3,3,3, new Vector3f(5f,4f,0f)); [/java]
How can I make the object in the line above move up and down in my update method?