overlap problem


I have a turret and an ai pawn that moves to attack it.

Booth of them have a big radius around them( about 1000uu) (in form of a mesh thats set to invisible) that looks for enemys (per get overlapping actors of class)

Now I have the problem that the turret attacks when the RANGEMESH of the AI pawn is overlapping the turrets range - so it starts shooting before the pawns mesh is actually inside the turret range.

Booth of them use “get overlapping actors of class” to get their enemies. now i know i could actually check later if the root component is really in distance but that overcomplicates it really hard (and prbably will eat lots of performance)

Is there any way to let the 2 “aggro range meshes” ignore eachother?

Here is a solution , with this it will detect when your character capsule is inside your trigger


first off, thanks for helping!

your first approach i allready thought about. but i was worried that it would be a really big hit on the performance with this approach (since the array will be 100 times bigger because theres everything in it, projectiles that are made of 5 components suddenly make the array bigger by 5 entries where as they didnt even show up before (with the get overlapping actors filtered by class)

there could easily be a few ai characters and a few players around that turret at any given time, so the “overlapping components approach” is quite hefty. in the beginning i also used begin overlap, but i had a few issues with that, and its not exactly how my turret works anyways. but i could re-do the whole turret ai with begin overlap only taking capsules of characters.

on the otherhand i hoped i could just modify the overlap behavior in some way.

another way came up when i discussed the issue with someone else who talked about how u can filter for subclasses. idk anyhting about those but i could also go for “get overlapping actors” and filter for capsules, wich again would drop my perfomance quite some. now i wonder if theres a way to set up subclasses for parts of actors (so i could possibly just filter for the mesh of the pawn or just the pawns capsule (and not the ones of projectiles))

anyways, to follow up with a bit more info i made screenshots of my bp

thanks so far

you can make your detection Triggers (ai and turret ) overlap only pawns

oh my god that worked. simply perfect.
I already thought about making subclasses in cpp.

allthough its not very logical for me since the aggroradius is part of the pawn, but **** im happy it worked.

thanks very much!

allright now theres been a few odd things here and there with other collision things (it didnt attack the character, and the melee AI didnt walk up to the turret iself anymore to attack it) but i just go over them all and hopefully get it right.

make sure you character capsule generates overlap events