Hit Event not triggering

Okay, I seriously don’t understand what is needed for a Hit Event to trigger.

I have the player shooting “bullets”, which I want to trigger a Hit when it collides with… stuff. I need the Hit because I want the exact location, which I don’t get with Overlap.

My projectile has a projectileMovement component, a mesh and a capsule collider with “Generate Hit Events” checked.

https://dl.dropboxusercontent.com/u/206884/ue4/bp_proj00.JPG

I’ve tried different things in my projectile blueprint. Having the capsule collider assigned to its own Hit event and/or just using the Actor Hit event.

https://dl.dropboxusercontent.com/u/206884/ue4/bp_proj01.JPG

and

https://dl.dropboxusercontent.com/u/206884/ue4/bp_proj02.JPG

However, I never get it to trigger no matter what it hits. I tried BSP (which I know shouldn’t work according to what I read, so that’s fine), static mesh, physics simulating meshes. But it never triggers. :frowning:

What’s needed?

Thanks in advance,

is this from one of the starter templates or a blank one?

It’s form a Blank one. :slight_smile:

I saw your post on the HUB and from what I see above you are not specifying what is being hit.

You could simplify this for testing and just use overlap event so that you can see if that is taking place at least.

Overlap is working and fire off as expected.

“what is being hit” - You mean in “other”. I shouldn’t have to define that unless I want to “use” it for comparisons or whatnot. Step 1 would be for the Hit Event to fire of when hitting any and everything.

Thank you,

Did you try to add a sphere in the components of the blueprint.
Then set the collision on the sphere and use the Event Hit node to detect the collision.

Hi Arcade,

I think the problem is that your collision preset is set to OverlapAllDynamic.
When this is the case you will only receive overlap events, not hit events. You’ll need to change the preset to something else (for example PhysicsActor)
Note that when you pick the preset it will show you under the drop box what objects it will block (hit), overlap, and ignore.

Yay! I changed it and it does indeed trigger now when hitting physics objects.
For some reason though, it does not trigger on Static Meshes - shouldn’t it?

Thanks! :slight_smile:

make sure that the static meshes have a collision mesh. you can check this and also see what it looks like in the editor.

Arcade, assuming that the static mesh has a collision mesh I would expect this to work. Is it possible you changed some of the collision presets?

Here’s some more information: Collision in Unreal Engine | Unreal Engine 5.1 Documentation

I’m coming back to this, after a looong break. The problem remains, and I cannot figure out why.

The objects **do **have collision.

I can go as far as to take a physics block with “Simulate Physics” ticked, make a duplicate of said object with the only change I do is to uncheck “Simulate Physics”. A Hit event will be generated on the physics one, no reaction on the other.

The projectile has “Block” on all Object Responses. (Physics object is PhysicsBody and none-physics is WorldDynamic. Also tried WorldStatic)

The object using he hit needs to be simulating physics.

I solved this problem without simulating physics by placing BulletMesh inside Capsule1 in the Components tab. I didn’t even know that it matters :slight_smile:

1 Like

I’m having the same problem and I looked at the collision component more closely in the first person template for the first person projectile to understand why I’m not getting hit events either. In this collision component for the sphere collider under Object Type I see Projectile. In my project for my projectile, I don’t see Projectile as something selectable.

unknown.png

The projectile is here under the tab that you have selected as “custom”.

I have the same problem, I have a generated terrain from brickgame and the my character pawn doesn’t collide unless I use the charmovement script, I want to use it as a top down camera and so far I have made the movement and zooming but the colliding is not working. I can only fire overlap between the terrain and my character’s capsule nothing else, I put an actor, a sphere with and without sphere collision and it keeps overlapping, I select blockAll to myself and the sphere actor but it doesnt register anything.
The sphere’s mesh has collision that I can see when i double tap the static mesh.
If characterMovement is enabled, it will actually collide and bump successfully on the terrain and register a hit but guess what, I start spinning randomly in random direction and random circles, its like when I bump slightly on the wall I am thrown away.
Interesting fact is that when I remove the walking from “default land movement mod” in characterMovement and choose flying the collisions stop occurring and I move through everything.

FIX
Finally I found a workaround after 3 days looking how to fix the collisions. If I get collisions when gravity scale is 1 and none at 0 then I went below 1, the lower I got the slower I got repelled in a random direction when I had a collision, AND at 0,0001 I have collisions with registered hits and no feedback/repelling after collision.

Hoping this helps someone, I found out that my custom actor movement was to blame. I unticked “Sweep” from one of the AddActorOffset, which is what stopped hit events from happening.

If you have a custom way you move your actor around, maybe check that you’ve ticked “Sweep” so it will generate hit events as it moves around.

2 Likes

Just in case this helps someone:
The collision component seems to have to be the root component in the Blueprint. If you have a mesh as the root and collision as a child, you don’t get hit events from sweeping. You’ll still get the hit events if something hits you, but not if you hit something else.

8 Likes

This did help someone else. Thank you!

1 Like

This solved my problem thank you! I have Collision Spheres that update every frame to the location of my players hands. The Set World Location nodes I used didn’t have sweep on. Now the Collision Spheres register hits.

1 Like

why ?
Seems the 2 solutions are :

  • make your colliding objects as Root component
  • or Enable physics

But in the case of a Capsule child of a Socket it does “not” work !