# Direction of movieclips

**URL:** https://forum.kirupa.com/t/direction-of-movieclips/13396
**Category:** Uncategorized
**Created:** [February 12, 2003, 8:44pm UTC](https://forum.kirupa.com/t/direction-of-movieclips/13396 "2003-02-12T20:44:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![schling](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@schling](https://forum.kirupa.com/u/schling)
#### Post date: [February 12, 2003, 8:44pm UTC](https://forum.kirupa.com/t/direction-of-movieclips/13396/1 "2003-02-12T20:44:44Z")

</div>

Hi

I am just wondering how I change the direction of a movie clip. And how to make it change in the same it’s moving.

I have random movement code on the clip, I just want it to rotate, in the direction it goes.

Did this make any sense?

schling

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 12, 2003, 9:37pm UTC](https://forum.kirupa.com/t/direction-of-movieclips/13396/2 "2003-02-12T21:37:50Z")

</div>

if you have its velocity on the x axis - vx, and on the y axis - vy, the rotation is found by saying:

\_rotation=Math.atan2(vy, vx)\*180/Math.PI;

make sure the unrotated clip is facing East (to the right)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 12, 2003, 10:12pm UTC](https://forum.kirupa.com/t/direction-of-movieclips/13396/3 "2003-02-12T22:12:30Z")

</div>

Thanks man 🙂
