# Random orbit around origin

**URL:** <https://forum.kirupa.com/t/random-orbit-around-origin/298585>\
**Category:** flash\
**Created:** [October 21, 2009, 1:55pm UTC](https://forum.kirupa.com/t/random-orbit-around-origin/298585 "2009-10-21T13:55:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raziel](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@Raziel](https://forum.kirupa.com/u/Raziel)\
**Post date:** [October 21, 2009, 1:55pm UTC](https://forum.kirupa.com/t/random-orbit-around-origin/298585/1 "2009-10-21T13:55:01Z")

</div>

Hi Kirupians,

I’m making a little kids game at the moment with all kinds of critters and such.  
I randomly place the critters around the stage. Now to give them some more life i would like them to wander around a little bit but not stray from their origin (the place they were initially put).

Now i recon i should store their origin in some vars and then setup a timer (or an onComplete with any random tweening engine) and then get new random coordinates to tween too that are within range.

I **think**.

I’m not sure if i’m on the right track as i can’t get this to work properly so far. If i could be nudged in the right direction that’d be great. (brownie points for examples!)
