Moving collision not working?

Hello! In my game I have a Box Collision component that is created and attached during runtime in the game. However, the overlap events only fire during the first frame it is spawned in. As soon as it moves, the collision stops working. I have nothing complicated going on, just what I described above.

Let me detail it a bit better:

  1. Player hits a key to attack
  2. Attack animation begins playing
  3. Collision box is created and attached to the sword’s socket and follows it perfectly

Now, the issue is that when the collision box collides with the actor it’s supposed to, the response varies:

  • If the collision happens in the very first frame of the animation, right when the box is created, it fires succesfully

  • If the collision happens any other time during the animation, it fails to fire.

Any help?

Thanks!

That is how overlap works. It fires once when you start overlapping, and there is another event when it ends overlapping.

When you detect that it starts overlapping, set a boolean variable to true. Every tick you can look at that variable to see if you are currently overlapping.

You could also just do your own box collision trace each frame, but that will take a little bit of processing power.

Thanks for the response!

I know that, I guess I wrote it kind of confusing. Let me detail it a bit better:

  1. Player hits a key to attack
  2. Attack animation begins playing
  3. Collision box is created and attached to the sword’s socket and follows it perfectly

Now, the issue is that when the collision box collides with the actor it’s supposed to, the response varies:

  • If the collision happens in the very first frame of the animation, right when the box is created, it fires succesfully
  • If the collision happens any other time during the animation, it fails to fire.

Do you understand better now?

Oh, that’s a completely different problem. Sorry about that.

No worries, completely my fault, realized how vague I wrote it. I’ll update it now.