# Facing direction MC Math.atan2

**URL:** <https://forum.kirupa.com/t/facing-direction-mc-math-atan2/301703>\
**Category:** flash\
**Created:** [December 14, 2009, 2:03pm UTC](https://forum.kirupa.com/t/facing-direction-mc-math-atan2/301703 "2009-12-14T14:03:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pafke](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pafke](https://forum.kirupa.com/u/Pafke)\
**Post date:** [December 14, 2009, 2:03pm UTC](https://forum.kirupa.com/t/facing-direction-mc-math-atan2/301703/1 "2009-12-14T14:03:57Z")

</div>

Hi,  
I’ve got a movieclip which follows a predefined path (like in those tower defense games). Normally the mc changes the direction it faces with Math.atan2 method and then rotates the movieclip, but because this game is in a tilted view( in stead of directly from the top) I need it to change the frame in the MC according to the direction it’s facing.

Is it possible to read out Math.atan2 method data, and then change the frame the MC is displaying, according to this data?

I used [http://www.walterreid.com/article/55/how-to-build-a-tower-defense-flash-game-part-3-rotation-and-realism](http://www.walterreid.com/article/55/how-to-build-a-tower-defense-flash-game-part-3-rotation-and-realism) as a base for this game.

If Math.atan2 method isn’t the best way to achieve this, then I’m open to suggestions.

Thnx in advance,  
Pafke
