How do you destroy a mesh by jumping on it?

Hello everyone,
I am new to UE4 and I have a small problem. In my third person game, I have a destructible mesh that I can destroy just fine, but I also want it to be destroyed when the character jumps (like bounces) on it.
I am not sure how to do that, your help is appreciated.
Thanks!

Thank you for you answer,
but I’ve tried both, and they didn’t take effect for some reason (nothing happens).

On component overlap - take damage!

That also didn’t work! The character steps on the mesh but nothing happens to it. Am I missing something with my character controls or something like that?

Of course your destructible mesh has collision… And it’s flags are set appropriately…

Thank you so much for following my issue and helping me, I appreciate that a lot.

I thought of your method but I saved it as the last solution, and it worked perfectly!!!

except for one small problem, that the character does not bounce on the mesh after destruction (not that big of an issue anyway).

Screen shots for what I did.

  • My blueprint.
  • My box settings.

86089-3.png

,

you must bind the event to the actor/object in the scene from the red connector at the top left of the node or override the function in the object you want to be destroyed. I would do the latter so you 't have to handle it per type. But i would also make this a base class and derive from it all the other classes i want to share this functionality.

Sorry, screen left not camera left. or “your other left”…

Thanks, I would love it if you tell me how to override the function in my mesh, I am a beginner and I barely know anything in programming.
Thanks again

Do the following:

Simulate physics on the top sphere. by turning on that property.

86142-simulatephysics.png

This will be a placeholder for your character. So whatever we do hence forth with the sphere, simply do the same to your character.

Play or simulate:

The ball will now fall, collide, and roll away.

86143-ballfall.png

Now in the lower ball’s blueprint, use the overlap event like so:

86145-destroyactornaive.png

This will naively destroy the lower object when another object overlaps with it.

Notice the lower ball is now gone:

Problem here is that any actor overlapping it will cause it to destroy.

So we need to check the other actors class like so:

And if you want to really be fancy you should use the player component and check its velocity against the up vector to establish an acceptable direction for “jumping on”. And velocity for speed. Alternatively, you can just evaluate the other actors relative position from you but that wont give you velocity.

Another way to achieve this same thing is with the “hit event” and that would give you collision hit/impulse information you could use to make this more fancy.

This should be enough to get you started though, and if you set it up on a base class, editing it once for all of your enemies/objects you want to have this behavior will allow you to propagate those changes throughout your entire game. After the destroy event you want to call another event that plays a particle effect and have a variable exposed on your enemies for “Death Effect” or something.

I hope this answers your question.

My previous comment was assuming you were trying to attach the event from another actor and that’s clearly not the case now.

answered below. I recommend however, you go through training videos on how to use blueprints and components and understand that there are many ways to solve the same problem.

Also not a bad idea to get familiar with programming concepts. It has helped me a great deal learning c# and c++ and the languages are not that difficult to understand, but very difficult to master.

You’ll be better for it. I hope my comments and answers are helpful to you.

Also, this can all be achieved without any components and simply checking distance speed and angle of approach. Good luck!

I followed your method, but the lower sphere would not be destroyed/disappear, maybe my ignorance is the problem, but I already got it solved with the trigger on my characters feet, this was the only was that worked for me.

However, I really appreciate the time you spend with your answer, and I will definitely take your advice on training videos, I’ve been considering for a while taking a training course on blueprints and programming in general, I will definitely do that.

Thanks again for your time and for helping, I wish you and everyone answered here all the best!

That’s totally cool, the important thing is that your issue is resolved and you’re happy with the results. Please accept grandcoders.com’s answer as the solution you went with to close the ticket for tracking purposes!

Good luck with your learning!

Thanks, I just did. I wish I could accept both your guys answers!