# Need help with MC collision/laser/hittest something like taht

**URL:** <https://forum.kirupa.com/t/need-help-with-mc-collision-laser-hittest-something-like-taht/119268>\
**Category:** Uncategorized\
**Created:** [August 12, 2004, 10:35pm UTC](https://forum.kirupa.com/t/need-help-with-mc-collision-laser-hittest-something-like-taht/119268 "2004-08-12T22:35:47Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![mdjstudios](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mdjstudios](https://forum.kirupa.com/u/mdjstudios)\
**Post date:** [August 16, 2004, 3:31pm UTC](https://forum.kirupa.com/t/need-help-with-mc-collision-laser-hittest-something-like-taht/119268/21 "2004-08-16T15:31:39Z")

</div>

well it still doesnt work, for my torpedo i have this code… i changed it and it seems to me like eex=1 doesnt really matter too much so i took that out to uncomplicate things. the torpedo explodes but still explodes if the shark touches a bubble or is like 20 pixel away from it.

```auto
onClipEvent (enterFrame) {
	if (this != _root.torpedo) {
		_x -= Math.sin((_rotation-180)*(Math.PI/180))*5;
		_y += Math.cos((_rotation-180)*(Math.PI/180))*5;
	}
}
onClipEvent (enterFrame) {
**if (this.torpedo2.t3.hitTest(_root.shark))**
this.torpedo2.play();
	
}

```

here is my code… the boldi changed to whatever u said

---

<div class="post-metadata">

**Author:** ![icio](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/icio/32/484_2.png) [@icio](https://forum.kirupa.com/u/icio)\
**Post date:** [August 17, 2004, 4:10pm UTC](https://forum.kirupa.com/t/need-help-with-mc-collision-laser-hittest-something-like-taht/119268/22 "2004-08-17T16:10:40Z")

</div>

i think it is likely that the code is working, although because of the rotation of the missile, and the way that the hitTest works, Flash returns a true with the hitTest instead of a false. If you look at the link i posted the other day, you’ll find a way around this.

check out this:  
**[http://www.kirupa.com/developer/actionscript/advanced\_collision.htm](http://www.kirupa.com/developer/actionscript/advanced_collision.htm)**

---

<div class="post-metadata">

**Author:** ![mdjstudios](https://avatars.discourse-cdn.com/v4/letter/m/e8c25b/32.png) [@mdjstudios](https://forum.kirupa.com/u/mdjstudios)\
**Post date:** [August 17, 2004, 4:41pm UTC](https://forum.kirupa.com/t/need-help-with-mc-collision-laser-hittest-something-like-taht/119268/23 "2004-08-17T16:41:58Z")

</div>

i did check that forum out but i dont want to all complicated like that. but i guess i can live without it. ill just call them, motion sensing torpedos. 🙂 thanks for you help you saved me a lot of time.

[Previous page](https://forum.kirupa.com/t/need-help-with-mc-collision-laser-hittest-something-like-taht/119268.md?page=1)
