title: Relative position in andengine
body: <p>Im trying to make a body move when you touch the screen. Left if you touch left from the sprite and right if you touch right.
  The bug i have is that that the body only moves a distance equal to the distance of the touch from the Sprite.</p>
  
  <p>And the way to fix this i understand is by modifing the touch event by the current camera position </p>
  
  <p>In all the following code <code>walkingActivate=true;</code></p>
  
  <p><em>Sprite onManageUpdate</em></p>
  
  <pre><code> @Override
          protected void onManagedUpdate(float pSecondsElapsed) {
              super.onManagedUpdate(pSecondsElapsed);
              if(walkingActivate) {
                  if (mActivity.touchedForWaling) {
  
                      if (!characterImage.isAnimationRunning()) {
                          characterImage.animate(new long[]{200,200,200,200,200},new int[]{1,2,3,4,5},true);
                      }
                      move(mActivity.SceneTouchEvent);
                  }
                  else{
                      characterImage.stopAnimation();
                      characterImage.setCurrentTileIndex(0);
                  }
              }
  
          }
  </code></pre>
  
  <p><em>Relevant code</em></p>
  
  <pre><code>public void move(TouchEvent event){
      float movement=.05f;
      if (event.getX()+mActivity.mCamera.getXMin()&lt;characterImage.getX()){
          movement=-.05f;
          characterImage.setFlippedHorizontal(true);
      }
      else {characterImage.setFlippedHorizontal(false);}
      PlayerBody.setTransform(PlayerBody.getPosition().x+movement,PlayerBody.getPosition().y,0);
  }
  </code></pre>
  
  <p><em>Part of Scene listener</em></p>
  
  <pre><code>if(currentPlayer.walkingActivate) {
                      mCamera.setChaseEntity(currentPlayer.characterImage);
                      if((!currentPlayer.onAir)&amp;&amp;(pSceneTouchEvent.isActionDown()||pSceneTouchEvent.isActionMove())){
                          SceneTouchEvent= pSceneTouchEvent;
                          Log.d("DEBUG","TouchEvent changed");
                          //this will trigger the walking action in the Sprite onUpdate
                          touchedForWaling =true;
  
                      }
                      else {touchedForWaling =false;}
  </code></pre>
  
  <p>The XMin method is not working so i dont know what else to try (besides <code>getCenterX()-getWithd/2</code></p>