# Random direction

**URL:** <https://forum.kirupa.com/t/random-direction/182972>\
**Category:** Uncategorized\
**Created:** [March 22, 2006, 9:02pm UTC](https://forum.kirupa.com/t/random-direction/182972 "2006-03-22T21:02:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otomo](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Otomo](https://forum.kirupa.com/u/Otomo)\
**Post date:** [March 22, 2006, 9:02pm UTC](https://forum.kirupa.com/t/random-direction/182972/1 "2006-03-22T21:02:06Z")

</div>

Hi!

I’m trying to make a ball move in a random direction.  
If I set the coordinates manually I can do that perfectly but not in a random way.  
How can I do this?

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [March 22, 2006, 9:09pm UTC](https://forum.kirupa.com/t/random-direction/182972/2 "2006-03-22T21:09:35Z")

</div>

use math.random

---

<div class="post-metadata">

**Author:** ![Otomo](https://avatars.discourse-cdn.com/v4/letter/o/ecae2f/32.png) [@Otomo](https://forum.kirupa.com/u/Otomo)\
**Post date:** [March 22, 2006, 9:24pm UTC](https://forum.kirupa.com/t/random-direction/182972/3 "2006-03-22T21:24:19Z")

</div>

Just found the tutorial i needed to my work. Any way, thanks for your help.

[http://www.actionscript.org/tutorials/intermediate/Random\_Functions/index.shtml](http://www.actionscript.org/tutorials/intermediate/Random_Functions/index.shtml)
