Disable physics when actor touches landscape

How do I check if an actor is touching the landscape?

I ticked the Generate Overlap Events on the landscape. What I want is when I drop an item (Actor), when it touches the ground (Landscape) its physics should be disabled.

I created a USceneComponent which with a function to disable physics on the owning Actor. What troubles me is how do I check if the actor is in contact with something solid or not.

It would be better if there was a way to check from the SceneComponent if it is touching something solid other than generating an overlap event only on the landscape. I want this functionality on other large static meshes too (ex. rocks, tables etc etc…)

Any help would be highly appriciated :slight_smile:

If you only need to detect the moment of impact, and not check at every tick of gameplay whether it is touching something or not, you could try using Hit Events instead of Overlap Events. So you would check “Simulation Generates Hit Events” on the item that gets dropped. What’s great about Hit Events, unlike Overlap Events, is that only one of the Actors involved in the collision needs to have “Simulation Generates Hit Events” checked in order for a Hit Event to register. So this should generate a Hit Event whenever it collides with anything solid and the “Event Hit” node will fire.

Sound good, I’ll try that, seems exactly what I need, thanks!

Is there a way to do it via C++ because I really am no good with Blueprints. I am still struggling to figure this one out.

I actually needed this and found out that Simulation Generates Hit Events is a variable in FBodyInstance as bNotifyRigidBodyCollision so If you set the mesh as true for this value the mesh will create OnComponentHit events so you can create a virtual OnComponentHit function and bind your meshes’ OnComponentHit to your class’s OnComponentHit with

Mesh->OnComponentHit.AddDynamic(this, YourClassName::OnComponentHit);

So you can achive what you needed