# 3D Collision

**URL:** <https://forum.kirupa.com/t/3d-collision/63680>\
**Category:** programming\
**Created:** [September 9, 2004, 2:18am UTC](https://forum.kirupa.com/t/3d-collision/63680 "2004-09-09T02:18:14Z")\
**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:** [September 9, 2004, 2:18am UTC](https://forum.kirupa.com/t/3d-collision/63680/1 "2004-09-09T02:18:14Z")

</div>

I followed the tutorials to make some 3d stuff, and I was wondering, is it possible to make it so you can’t walk through walls and such? .fla attached

---

<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:** [September 9, 2004, 5:47am UTC](https://forum.kirupa.com/t/3d-collision/63680/2 "2004-09-09T05:47:28Z")

</div>

Yeah it is possible to do 3D collissions. It’s rather difficult to explain but there is a process of doing it. First off, you would want to test 3d point allocations to your current position. So therefore, you would have to create a 3dhitTest. This hitTest would scan over not only x and y… but the z plane as well. Just as if you ere doing a complex 2d figure, you would test collission with multiple points, well, with the 3D figure, you would have to test with almost 3-6 times as many points… This could present a problem eh? 🙂

Just some random thoughts.

---

<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:** [September 9, 2004, 7:36pm UTC](https://forum.kirupa.com/t/3d-collision/63680/3 "2004-09-09T19:36:27Z")

</div>

It’s best to cheat for now and approximate it, in my opinion.

If you want to be more exact: the scaled percentage can tell you approximate Z-Level. So if the X and Y line up, and if Scale is +/- 10% of the position of the object, you score a hit.

If you don’t scale your 3-D this way (faking perspective with scaled movieclips), you can keep track of it with another variable called ObjectZLevel. Check it against something like CurrentZLevel and ProjectileZLevel. I’m working on a new 3-D example to illustrate this better.
