# Keeping objects from intersecting

**URL:** <https://forum.kirupa.com/t/keeping-objects-from-intersecting/116428>\
**Category:** Uncategorized\
**Created:** [July 18, 2004, 12:16am UTC](https://forum.kirupa.com/t/keeping-objects-from-intersecting/116428 "2004-07-18T00:16:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dangerskew](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@dangerskew](https://forum.kirupa.com/u/dangerskew)\
**Post date:** [July 18, 2004, 12:16am UTC](https://forum.kirupa.com/t/keeping-objects-from-intersecting/116428/1 "2004-07-18T00:16:46Z")

</div>

I’m having trouble getting this work. I have two squares, one that the player controls, and one that stands still. I’m trying to make it so when you hit the still square with the controlled one, it can’t go through it. I don’t want the one to bounce off. I want it to just stop, and not be through the still one. The fla. is attached. Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 20, 2004, 5:25pm UTC](https://forum.kirupa.com/t/keeping-objects-from-intersecting/116428/2 "2004-07-20T17:25:48Z")

</div>

hi dangerskew

just add this to ur unmovable square.

```auto
 
onClipEvent (enterFrame) {
 if (this.hitTest(_root.playersquare)) {
  _root.playersquare._x = this._x-10;
 }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 20, 2004, 8:22pm UTC](https://forum.kirupa.com/t/keeping-objects-from-intersecting/116428/3 "2004-07-20T20:22:27Z")

</div>

and might i suggest reversing the controls while going backwards???
