title: Unity3D: Left Joystick Translation Depending on Facing Direction
body: <p>I'm hitting a wall on this really simple problem... I know there has to be a simple solution, but I'm not exactly sure what it is. I'm prototyping for a game jam -- my game is a top down, 3D twin sticks style game. The right stick rotates the player and the left stick controls the movement. The movement is done via animations in Mecanim -- I have forward/backward/strafing setup and blended.</p>
  
  <p>My problem is right now it moves like Resident Evil -- "up" on the joystick drives the character forward no matter what direction she is facing. I need to translate "up" on the joystick to be relative to the world -- not the player (ie: if facing right, "up" should make her strafe left). What am I trying to find? I'm pretty sure there's some built it translation that I need to call...</p>
  
  <p>I'm using Unity and am sending Horizontal and Vertical values between -1 and 1 to Mecanim. I need to translate these values based on character rotation so "up" moves the character toward the top of the screen based on it's original rotation. </p>
  
  <p><a href="https://i.stack.imgur.com/hYMuU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hYMuU.jpg" alt="Image 1"></a></p>
  
  <p><a href="https://i.stack.imgur.com/3g5Nw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3g5Nw.jpg" alt="Image 2"></a></p>
  
  <p><a href="https://i.stack.imgur.com/TrwTk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TrwTk.jpg" alt="Image 3"></a></p>