 <p>try this, if Z axis is your forward direction:</p> <pre><code>for(var i=0;i&lt;10;i++) { gun.transform.position += gun.transform.forward; yield return 0; } for(var i=0;i&lt;10;i++) { gun.transform.position -= gun.transform.forward; yield return 0; } </code></pre> <p>this will move the gun in the forward direction of the gun</p> <p>if you turn, the forward direction is not (0,0,1)</p> <p>you can also use this if X axis is your forward direction:</p> <pre><code>for(var i=0;i&lt;10;i++) { gun.transform.position += gun.transform.right; yield return 0; } for(var i=0;i&lt;10;i++) { gun.transform.position -= gun.transform.right; yield return 0; } </code></pre>