title: SceneKit - Modifying velocity for the direction a node is facing
body: <p>I'm currently working on an ARKit game using SceneKit and I am having trouble controlling and moving the nodes. The layout for the game is quite simple, I have a node representing a tank that has a dynamic physics body. I can successfully add the node to the map, however I want to control the node using a joystick.  </p>
  
  <p>I am trying to modify the tank's velocity property so that when the joystick is pushed up the tank moves forward in the direction that it is facing. To do this I first tried to simply just set the velocity property as such:</p>
  
  <pre><code>t.physicsBody?.velocity = SCNVector3Make(0, 0, -0.15)
  </code></pre>
  
  <p>This caused the tank to move with the desired speed however it was not in the correct direction. As I understand the -z direction is the forward facing direction. Apple's documentation for local vs. world space is very vague and after looking around online I found this stack overflow article <a href="https://stackoverflow.com/questions/32038480/scenekit-physics-add-velocity-in-local-space">SceneKit physics add velocity in local space</a>. I have tried converting to the parent's node which still doesn't have the desired effect. I have also tried using the presentation node's physics body which has updated values but both ways are causing jittery, non-uniform, and unpredictable movement. </p>
  
  <p>I would use forces, however I want the SCNode to have a very immediate and cartoonish movement without acceleration. Any help understanding what is going on and on SceneKit's way of handling movement would be appreciated.</p>