HitTest Function

I cannot use any item for hitTest. Say I have a clip called "Bleeb"that I want to collide with another object, it will not work.

if (this.hitTest(Bleeb) && if KeyDir ===1 {
}
Any help?

3 Likes

Please take a look at this quick project I made that should show you how to make a hitTest event.

My Project (1).wick (1.8 KB)

if you need any further explaination, don’t hesitste to ask!

3 Likes

Thanks for the help! :smile:

2 Likes

No problem! Always
happy to help!

1 Like

hey, can I also have some help with something? I know this thread was made like 5 months ago but I’m making a game and it’s basically if this enemy sprite hits the maincharacter sprite it removes itself. It just says: “oP is not defined” as an error.

is oP a object?

a clip, it’s a clip

okay well what my guess is that you have a syntax error. Make sure you made the object have it all lowercase as its name. then go back to your script and change it from oP to op.

thanks for the explanation

no problem :slight_smile:

it may also be a targeting path issue
After checking the name is correct try to target the clip using absolute path like
project.possibleContainerClip.oP