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
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.