Simple question about Hit-Events

Hi, I’m very new to UE4. I am currently writing my first Actor-derived class to get familiar with the API.

I just made a dynamic sphere that has an audio- and particleSystem component attached to it, so when it hits something, it goes boom ^^

I override NotifyHit for this. I started the project on the 3rd person template and when I run the character into this thing, it works as expected. But I can’t figure out how to get the function to be called for static world collisions… I tried using different collision settings, but it didn’t help.

How are you setting up your NotifyHit and which object is handling the resulting logic? What type of object are you trying to make your sphere hit? We’ll need more specifics before being able to give any type of advice as to what is wrong in your particular situation.

I declare
virtual void NotifyHit (…) override;
inside the new actor class.

The implementation only does this:
audioComp->Play();
particleComp->ActivateSystem();

So the resulting logic is handled by the actor. I use a sphere-component as the root-component and enabled physics on it, so the event should be triggered here, I guess.

I want the sphere to react to any kind of hit (with a force-threshold). Collisions already happen, but not the notifyHit-call when dealing with world geometry.

The first thing to check would be to see if the option for “Simulation Generates Hit Events” is on. This could be the issue if only character movement has been causing it to trigger. In the meantime, I’ll be looking into reproducing the problem you’re having.

It’s checked on the sphere-component, where I also checked simulate physics.

Wether or not I also check it on the level geometry doesn’t seem to make a difference.

edit:
I think I know now what’s the problem. Apparently, the staticMesh (static sphere-mesh) component on the actor is also causing collisions, even though I didn’t enable physics on it. Does this mean I have to set “no collision” on every static mesh I use, otherwise the engine will create a complex physx convex mesh shape for it (like the graphical mesh)?

edit2:
Ok… so some meshes have primitive collision shapes attached to them. Before I ask any more questions, I guess I should take another look at the documentation. Thanks anyway.

That is correct, when it comes to collision, if you already have a collision volume set up for your component, it is best to have the collision disabled, as the animations of the mesh could cause collision issues that aren’t intended. Please let me know if you continue to have issues with this functionality.