# I'm making an RPG and need help being blocked by objects

**URL:** https://forum.kirupa.com/t/im-making-an-rpg-and-need-help-being-blocked-by-objects/285743
**Category:** flash
**Created:** [April 5, 2009, 5:07pm UTC](https://forum.kirupa.com/t/im-making-an-rpg-and-need-help-being-blocked-by-objects/285743 "2009-04-05T17:07:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![chronoshift](https://avatars.discourse-cdn.com/v4/letter/c/a9a28c/32.png) [@chronoshift](https://forum.kirupa.com/u/chronoshift)
#### Post date: [April 5, 2009, 5:07pm UTC](https://forum.kirupa.com/t/im-making-an-rpg-and-need-help-being-blocked-by-objects/285743/1 "2009-04-05T17:07:37Z")

</div>

So I’m making an RPG and I already have most of the code in my head, but what I can’t figure out (in my head) is how to code and object so that when my character runs into it he/she stops moving in the direction of the object.

I’m sure I could make some obscene repetitious code that cancels out the x, y movement of the character but I’m wondering if there isn’t something easier or more effective.

edit: also I’m working in CS4 but I’m doing AS 2.0
