Fixed mouse targetting and refactored a part of ther direction calculation. Now it only updates the values at target's position change.