Collision : Simulation Generates Hit Events = false

Greetings to all, I have been searching all over the unreal engine API and forums, everywhere to find where this little “bool” is located. Here i have provided a screenshot from a Actor-Blueprint to illustrate.

Red represents what i’m searching how to set through c++.

I was only able to find the function “SetGenerateOverlapEvents(true);” I have searched for hours, with UPrimitiveComponents,UObjects… etc EVERYWHERE. But i had no luck. Please for the sake of my sanity, can you ease my pain and tell me how can i set this through code so i don’t have to “tick” that little box every time i create a blueprint of a c++ class.

Thank you for understanding. Unreal team, you are doing Gods work with your engine. I love how Unreal is… unreal. 10/10

The naming is not very clear, but the equivalent C++ function is [SetNotifyRigidBodyCollision][1].

So, assuming you’ve created a child of UPrimitiveComponent, for example UStaticMeshComponent, then in your constructor call StaticMesh->SetNotifyRigidBodyCollision(true); and the Simulation Generates Hit Events field will be updated to default to true in your inspector.

Hope that helps!

1 Like

THANK YOU SO MUCH kind stranger, this function name was so misleading that i couldn’t find it at all.

Now i don’t have to tick that box every time i create a new instance. It works like a charm :slight_smile:

Glad it worked! :slight_smile:

I could not get this to work for a skeletal mesh.

Static mesh and skeletal mesh always had different functions.

To find an equivalent, you should read the skeletal mesh header file. Or whatever it inherits from.

Names are all missleading, but you may be able to pull a rabbit by searching the header file for the in editor UI text. Sometimes the functions have comments to generate or match the UI… albeit far too rarely.

Its not a rigid body, so maybe you can also search it for “SetNotify” and see how many results you get…

Ok, thank you, will give it a try