Another bug is that math behind your CONE targetting and queries is valid only for Cones 2D. 3D cones draw proper debug shape but the math you do later to filter targets is just wrong.

Basically if something is to the left or to the right (is not aligned to X axis of the world) it will get filtered out.

That's because you base your vertical filter on X and Z axis, but when instigator that you base your cone rotation on, will be rotated in a way the he alignes himself to Y axis, your X is 0 and you get nothing.

I fixed it locally by adding my own Cone implementation, but basically what you want to do, for vertical part, is to, instead of taking X, take length of 2D Vector from X and Y as first axis and then add Z axis.

So instead of doing:

you want something like:

Basically if something is to the left or to the right (is not aligned to X axis of the world) it will get filtered out.

That's because you base your vertical filter on X and Z axis, but when instigator that you base your cone rotation on, will be rotated in a way the he alignes himself to Y axis, your X is 0 and you get nothing.

I fixed it locally by adding my own Cone implementation, but basically what you want to do, for vertical part, is to, instead of taking X, take length of 2D Vector from X and Y as first axis and then add Z axis.

So instead of doing:

Code:

FVector2D toTargetXZ = FVector2D(toTarget.X, toTarget.Z);

Code:

float firstAxis = FVector2D(toTarget.X, toTarget.Y).Size(); FVector2D toTargetXZ = FVector2D(firstAxis, toTarget.Z);

## Comment