Download

Sonic Homing Attack?

Hi all,

I am currently trying to recreate sonics homing attack from the adventure series.
I partly understand how the logic of the homing attack would work but I am not sure how get it into blueprints.

General Idea:
cast a linetrace (though I will need it wider than a line) when in air, if colliding with enemy launch towards enemy on jump press.

But not sure how I would execute this properly or how to lock onto the closest enemy…

I have looked at the dash engine but I would like to learn this from scratch.

Any help would be greatly appreciated.

hi @jamiefeatures
You can take a look at boxtrace and spheretrace
WTF Is? Box Trace By Channel in Unreal Engine 4 ( UE4 ) - YouTube

to find the closest enemy you can run a check using
get all actor of class and getting all the location and saving the distance of the enemy in a array

than you can find the lowest distance Min Of Float Array | Unreal Engine Documentation

but you have to check the direction too, because the homing should work only on enemy in front and not in back , true?

And once found the right enemy, you can save a reference to him.
and use the reference to guide your homing attack on his location

3 Likes

I will definitely give this a shot!
Hopefully should be relatively straight forward but we will see ( it’s never as simple as it seems! ).

Thanks a lot!