How do make destructible mesh counter that goes up by 1 after you destroy a destructible mesh?
Maybe a pic will help. I pretty much want to make it so when the object gets hit, the target counter will go down by one. Trough right now it’s not interacting at all. I can obviously do the counter part myself.
That blueprint doesn’t make much sense.
First you shouldn’t be using the other actor node from OnComponentHit in OnComponentFracture, if that works at all it will probably only work some of the time.
Second, why are you casting other actor as a GameMode? GameModes shouldn’t have collision so you wouldn’t ever hit them. Try using the “Get Game Mode” to get your game mode and then cast it to your GameMode class.
Yeah, the script works even when the on component hit isn’t going anywhere.
Could you show me how to a quick print string on componenet hit. I can take it from there.
This would be so much easier if it was just normal programming. <_<
Something like this maybe?
It’s still not showing anything when the object gets hit.
Really the basics of what I’m trying to do is check for a hit against a DestructibleActor, then Get a variable from the GameMode then set the variable -= 1;
This works for me:
Prints “fractured” when something breaks the destructible mesh.
I think your problem is you were trying to set a variable on an object that doesn’t exist. I marked up your image, maybe that will help:
Okay, I"ve got the counter working from the firstpersoncharacter’s bullet area. Now I just need figure how to check the type of collision.
Not sure what you mean by ‘type’ of collision. You can get the actor that hit the destructible mesh by using this:
You have to turn on “Simulation Generates Hit Events” under the collision settings of your destructible mesh for this to work though. It’s off by default, I assume as a performance saver.