How do i dectect/destroy actor when touching an object?

I’ve been looking for around 5 hours now, and am really struggling here. I want to destroy the actor when it hits anything but the player, and I can get the actor to detect other actors, but not the default floor you get in the example map. I would really prefer not changing the floor to a blueprint, as that introduces a lot more manual labour, and was just wondering if there was a simple way to do it. I’m fairly new to unreal engine, and any help would be much appreciated!

I want to destroy the actor when it
hits anything but the player

341883-screenshot-3.png

Here’ we’re checking whether the hit is against the player; if it is not, the actor destroys itself.

Image from Gyazo

The description and the request are somewhat unclear, though. We don’t know how you’re moving things and how the collision is set up. The right approach would revolve around a specific scenario.

There many ways to filter what interacts with what an how. [Collision filtering][2] and using tags are quite reliable.

If the above does not help, perhaps describe how the feature would work in game from the player’s perspective. So we can suggest something that fits right into your already existing system.

Yes, I had tried that. The problem is, anything that is not a blueprint will not call event hit, or anything else for some reason. It interacts with the player just fine, but just rolls around on objects like the floor or stairs without doing anything

Alright, an object would spawn above the players head that faces towards the cursor. Once the LMB is released, it would go flying towards the spot that the cursor was on. This is done in third person.

Physically simulated static meshes do not call hit by default:

Already enabled, enabling it on any static mesh at all doesn’t change anything

So it all boils down to the fact that the physics simulating static mesh cannot detect a hit, is that correct?

  • is the mesh the root of the actor?
  • how are the collision channels set up on that mesh vs what the mesh it is supposed to collide against?

The above was done will default settings apart from the Simulation Generating Hit Events set to True.

You can also try it with the pertinent component’s hit (in case there’s more than one, or the actor employs a more complex hierarchy):

341879-screenshot-2.png

It’s still a bit unclear to me how the whole thing is done. We’ve yet to see any script - that usually clarifies a lot.

So it all boils down to the fact that the physics simulating static mesh cannot detect a hit, is that correct?
basically, yeah, and as for how it works it’s pretty much just a stripped-down version of what you mentioned earlier. I’ve also tried other methods, including methods with on component hit, but it all results the same thing.

Just an update, I created a completely new project and did the same and it works fine. ???
If you can figure out what’s wrong with that project that would be amazing, but if not, i’ll just start over, not too much extra effort

Make the object the root, as mentioned above - this is critical for simulation (for a number of reasons but here would work as is). And enable simulating hit events and that’s it.

If you can figure out what’s wrong
with that project that would be
amazing

Not without seeing the project, what you show in the screenshot should work as is (with simulating enabled and it generating hits). If it does not, the issue is elsewhere.

Alright, an object would spawn above
the players head that faces towards
the cursor. Once the LMB is released,
it would go flying towards the spot
that the cursor was on. This is done
in third person.

How close is this:

Check the vid in the post. This is using the homing feature of the Projectile Moving component. How is the flying part done. The way you move stuff can affect how things react to it, for example.

I’m just gonna assume the problem is elsewhere, because I’ve done all this and it still doesn’t work. I did create a new project and got all the functionality working there however, so sorry to any onlookers for not answering your problem