Event BeginOverlap not always working

So i’m making an fps game, and when i fire a weapon it spawns a bullet. When this bullet overlaps a player, it should deal damage. This all works fine when i have a framerate of 50+. But when my framerate drops below this, the overlap event in the character blueprint doesnt always trigger, even though i’m sure the bullet hits him. I also noticed it has to do with the speed of the bullet, lowspeed bullets trigger the overlap event more often than high speed bullets. How can i make the overlap event always work?

(something like priority or forced updating maybe??)

This is the blueprint in the character:

does it have a projectile movement component? if so, take a look at “projectile simulation” category.

227069-p.png

I would do it a bit differently.

  1. Don’t use actor overlap, use component hit (the component that is set up to collide)
  2. Turn on “CCD” for that component

Then your bullets won’t go through anything, even when the frame rate drops.

Another tip: don’t use meshes for stuff like bullet collision. Your root component should be a Collision sphere (or capsule) and your mesh should be its child. Set the collision component to collide with things and set your mesh to No Collision.

yes it does, but all maxed out!

227127-max.png

I don’t know how to set this up with event hit. when i set the projectile movement to 0, it does register hit events with my player pawn, but when the bullet moves it doesnt…can you make an example?

Here’s what you do to get the mesh to never go through another object that it’s set up to block.

  1. Make sure the mesh is the root component, and set it up for blocking collisions with the things you want bullets to hit
  2. Select the mesh and scroll down in the details panel and look for the green buttons, click on the one for “OnComponentHit” and add your reaction code after the event node that is created
  3. In the mesh details panel, search for “CCD” and enable it (Continuous collision detection)

I recommend using collision boxes/spheres/capsules because mesh collision can cause problems in some cases. Better to just use colliders, but you should be fine in this situation.

There are dozens of video tutorials covering projectiles and hit events. They may be able to show you better than I can explain in text…

Side note: you cannot have Simulate Physics enabled when using a projectile movement component (and your collision mode should be “Query Only”).

The previous answers are all valid ways of handling projectiles for FPS games, though I figured I’d go ahead and throw out the idea of using line traces instead of projectiles on the off chance you didn’t know about them. Of course, there could be a hundred reasons you’d want to use projectiles instead of traces, situation dictates really, just thought I’d put it out there since it wasn’t mentioned yet.

Thanks for your answer. The game is actually an airsoft game, which means bullets go “slow” and there is a delay between shooting a projectile and hitting someone. If i’d use a line tracer, this would be very difficult as you understand. Sorry for my unclear explanation :wink: thanks for the answer though! Appreciate it

Oh well. Thanks for your answer. Figured it was the root component thing, i had my hitbox as a child of the mesh. I’m still using overlap events with a hitbox because i’m more familiar with overlap events. Your trick did it thought! Thank you very much!

Hey fair enough. I just didn’t want to assume that you already knew about an alternative way of doing it. Sounds like your reasoning is completely valid though. Best of luck to you and your development.