Make spatial global

Hi there. Im new to jme so is there any way to make spatial “tank” global? I need to give a direction however jme says “cannot find symbol”
Here’s some part of my code

 public void simpleInitApp() {      
  Spatial tank = assetManager.loadModel("Models/untitled123.blend");
  tank.scale(2f, 2f, 2f);

private AnalogListener analogListener = new AnalogListener() {
public void onAnalog(String name, float value, float tpf) {
  if (isRunning) {
      speed = 5; 

    if (name.equals("Right")) { // Si la touche D=1
      v = tank.getLocalTranslation();
      Quaternion roll45 = new Quaternion();
      v = roll45.mult(v);
    if (name.equals("Left")) {
      v = tank.getLocalTranslation();
      Quaternion rol45 = new Quaternion();
      v = rol45.mult(v);
    if (name.equals("Avant")) {
      v = tank.getParent().getLocalTranslation()
      tank.setLocalTranslation(v.x , v.y , v.z - value*speed);

    if (name.equals("Arrière")) {
      v = tank.getLocalTranslation();
      tank.setLocalTranslation(v.x , v.y , v.z + value*speed);

Thanks in advance

Are you trying to access ‘tank’ inside ‘onAnalog’ ?
I would recommend you to learn basics about programming, classes, members etc.

This isn’t really a JME question but a Java-beginner question.

You’ve defined “tank” only in that method so that’s the only place you can use it. Basic language scope stuff.

You might consider doing some simple Java tutorials before branching into more advanced stuff. It will probably save you a bunch of time and let you have lots of Java documentation easy to hand.