# Need help for rotation

**URL:** <https://forum.kirupa.com/t/need-help-for-rotation/263895>\
**Category:** Uncategorized\
**Created:** [June 20, 2008, 7:19am UTC](https://forum.kirupa.com/t/need-help-for-rotation/263895 "2008-06-20T07:19:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadowkeeper](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@shadowkeeper](https://forum.kirupa.com/u/shadowkeeper)\
**Post date:** [June 20, 2008, 7:19am UTC](https://forum.kirupa.com/t/need-help-for-rotation/263895/1 "2008-06-20T07:19:37Z")

</div>

i have a object which is duplicated 10 times and they all move  
same direction i want all the objects(the main one and the  
duplicated ones) should have different directions and i have written  
the code for mouse but instead i want it to happen without the help of the mouse

Code for the rotation of the object with the help of the mouse

```auto
dify = _parent._ymouse-_y;
    difx = _parent._xmouse-_x;
    
    _x = _x+(difx/5);
    _y = _y+(dify/5);
    
    // Calculate the angle
    myangle = Math.atan2(dify, difx)*180/Math.PI;
    
    trace("_rotation=========" +_rotation);
    
    _rotation = myangle;

```
