# How to orbit one mc around another, but always facing?

**URL:** https://forum.kirupa.com/t/how-to-orbit-one-mc-around-another-but-always-facing/271799
**Category:** flash
**Created:** [September 28, 2008, 9:38pm UTC](https://forum.kirupa.com/t/how-to-orbit-one-mc-around-another-but-always-facing/271799 "2008-09-28T21:38:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![NHansen](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@NHansen](https://forum.kirupa.com/u/NHansen)
#### Post date: [September 28, 2008, 9:38pm UTC](https://forum.kirupa.com/t/how-to-orbit-one-mc-around-another-but-always-facing/271799/1 "2008-09-28T21:38:13Z")

</div>

Hello, I am using this script to rotate one mc (cloud) around another (grass), but what I can’t seem to figure out is how to change the rotation of “cloud” so that it is always facing the center of it’s orbit

```auto
var radius = 1200;
var degrees = -120;

onEnterFrame = function (){
angle = degrees * (Math.PI/180);
degrees += 1;

xposition = radius * Math.cos(angle);
yposition = radius * Math.sin(angle);

cloud._x = xposition + _root.grass._x
cloud._y = yposition + _root.grass._y
cloud._rotation += 1;

updateAfterEvent();
}

```

right now I am just using “cloud.\_rotation += 1;”, but it obviously doesn’t rotate the correct way.

Can anyone help me out? Hope you understand what I mean.
