Killing enemy while faster than X speed

I’m trying to make a sonic fan game and I’m trying to replicate the mechanic where Sonic boosts and destroys the enemy but can’t destroy the enemy when they’re not boosting. Screenshots or tutorials of the script would be extremely useful as I’m still new to UE4.

did not test but maybe this could do thetrickl or at the very least offer help

This is easy. :slight_smile:

Make a variable, which is a bool, call it “IsBoosting?”

Then when you activate your boost skill (making your character super fast, right?), then “set” the bool to “active”. If you stop the boost (release the key), then “set” the bool to “not active” (just uncheck that box).

Now you can make a simple “if node” function, that checks if the “IsBoosting?” bool is activated, and if yes (true), then you destroy that enemy actor. If it’s not activated, then you don’t destroy it.

EDIT: Attached a image to show how you set it, and another one how to destroy the actor. This should work I think, but you need a collision box in your player actor that generates an overlap event on “pawns” (try out which collision preset works).