Overlapped Melee Collision Not Firing (Paper2D)

Hello everyone. I’m working on this paper2D project and I can’t seem to find out what is causing my collision to not fire during the player’s attack. I have a basic kick flipbook and I added a sphere collision to the playerbp. I have it visible in the viewport so I can see it and make sure that it attaches to the right socket.

Now I have the basic begin overlap to destroy the enemy and when I walk through it and it touches that sphere it works. But when I pressed the attack button for the kick, when it overlaps it doesn’t fire. I’ve tried to enable collision node to see if maybe it turns off the collision for some reason but that didn’t work either. So if anybody have any idea, please let me know/

Thanks

Here are some screenshots and a quick video of it.

[MeleeTestingVideo][1]

Are you sure you set the collision channels correctly on the kick sphere? It might be useful try to debug using print string to see if it is colliding with the enemy. So basically pull of the overlap event and from the “other actor” pin → build string → print string and see what value you are getting. Another thing might be useful is to see if the cast to enemy is failing. So add a print string at the end of the cast failed.

I’m not sure what your animation bp looks like, but its easy to activate and deactivate the collider collision based on “animNotifies”. Using them you can activate and deactivate collision on a certain frame of the animation.

The Issue might be do to that you are attaching the collider as you kick, which is not a very ideal solution in my opinion.

You want to attach the collider on event begin play, and activate the collider everytime you kick and deactivate it when the kick is ending.

Hope this was somewhat useful, I’ll be happy to help more if this was not enough info.

Have a nice weekend
-SamuelB

Thanks, I’ll see what happens. I just use a enum state to call the flipbooks. I got it from the Alan Noon paper2D series.

And I think, last time I checked, AnimNotifies are not available for paper2D. But thanks for the feedback, it helped me think of other ways to figure out what works.

So after brainstorming and just going crazy, I figured out how to get the very basic melee attacks working so I will share it with everyone that is in the same boat.

First I created the collision box under my character bp and made sure its collision was set to on. Then I added another sequence node to run on my event begin play. That node is the Set Collision node, of whichever collision volume you want to target, and set it to none. (You can do this with or without parenting the collision to sprite sockets. If you don’t want to use sockets, just place the collision box where you want the hit box to be. The easiest way to do this is to change your source FB under your sprite to the flipbook animation that will use the hitbox and then just line it up.)

226119-melee3.jpg

Then under the attack event, I called the enum to play the flipbook, and then added a retriggerable delay, and then a set of set collisions to turn it on and then off. The delay you will have to play with cause that is based on your flipbook’s motion, and fps.

And then just set the begin overlap and cast to whatever you want and it should work. If anyone has any questions, I’ll do my best to try and help if I can.

Ah yes, i’m not too familiar with paper2d. I’ll try and investigate and see if i can come up with something. If you are following a tutorial series, you probably just missed something.