# Movement script

**URL:** <https://forum.kirupa.com/t/movement-script/227520>\
**Category:** Uncategorized\
**Created:** [May 30, 2007, 11:48pm UTC](https://forum.kirupa.com/t/movement-script/227520 "2007-05-30T23:48:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hansol](https://avatars.discourse-cdn.com/v4/letter/h/958977/32.png) [@Hansol](https://forum.kirupa.com/u/Hansol)\
**Post date:** [May 30, 2007, 11:48pm UTC](https://forum.kirupa.com/t/movement-script/227520/1 "2007-05-30T23:48:40Z")

</div>

I was trying to come up with some AI for a car so it had set checkpoints to meet. the code might not look like it now but its what i hope to make, if someone knows a better way to make some car ai plz let me know, but anyways i was trying todo some code and i did this:

```auto

cords = new Array();
cords.push([100, 150]);
cords.push([500, 200]);
var num = 0;
function moveobj(obj) {
    trace("X:"+cords[num][0]+" Y:"+cords[num][1]);
    obj._x = cords[num][0];
    obj._y = cords[num][1];
    num++;
}
setInterval(moveobj(circle), 1000);

```

the setinterval doesnt work, if anyone knows how i could get it to work plz let me know, thanks.
