GetOverlappingActors returns None

I have several enemies that walk inside some zone. I want them to immediate kill the player when he leaves zone. But trying to get the reference to that zone leads to nothing. Here are my blueprint and collisions.


2023-05-09_23-30-18
2023-05-09_23-31-18

you are overlapping all actors. so absolutely anything could end up as the 0 index in that array.

you need to be more selective with either how you filter the array, or what you allow to go into it.

You can either only allow actors of a specific type to be added to the array. Or you could search the array only for a specfic type.

My preference would be to make a custom collision channel and only have the overlap work for that channel.

Hello! Overlapping all actors is for debug, in the normal mode there is filter by class there. But even with overlapping “anything” there is nothing in that array. Why this can be?

Well it looks like the Block All does not perform any overlap. You should set to custom and make sure the channels you want to overlap are set to overlap.

collision presets → custom → then set like pawn or whatever to overlap

overlap is a separate type of check compared to hits. If two things that block bump into eachother, a hit event is performed. if two things set to overlap, then overlap is called.

Are you saying IValidIndex returns false or that Zone variable is null?

@BIGTIMEMASTER But block is performed only in one direction, with overlap in another one. I cannot make enemy overlap WorldStatic because it will stop colliding with everything, including landscape, “outer” zone which prevents enemies to get to any point in the world and so on. Enemy must block WorldStatic.
@pezzott1 IsValidIndex returns false.

gotcha. Probably look into custom collision then, this way you can just have a specific channel for overlapping with this type of trigger.

first I’d set both to overlap and just double check that they can successfully overlap at all. You can set a print string or breakpoint on an On Begin Overlap to confirm that happens successfully. If both actors are set to overlap all and the trigger never fires an overlap event, then I’d expect that it’s collision properties were overriden somewhere.

If that is a success, then you know that collision is working at all, and so the next step of filtering the collision via a custom channel would solve the problem of being able to overlap the enemies without them having to overlap with everything else.

1 Like
  • asking because can’t see in the image: is generate overlap ticked in the second image?
  • is this actor spawned inside the zone?
  • is the zone spawned before or after this actor?
  • What component(s) generate overlap for this actor?
  • could you share an image or clip of this actor spawning in the level with the zone also visible?
  1. What does “ticked” mean?
  2. It is placed there before the game start.
  3. Both of them are placed in the editor before the game start.
  4. In the enemy - capsule, in the zone - static mesh.
  5. Zone is not visible.

With a .

What happens if you add a delay right before your “Get overlapping Actors” node?

Why not use the “On Component End Overlap” Event, instead of trying to get a reference to your zone? Create a Blueprint for your overlap volume. When the End Overlap event triggers, check if the actor is your player (Add a “Player” gameplay tag to your player character, or use get player pawn, etc). Then trigger an event from there.

As you can see, GenerateOverlapEvents is ticked twice. If you mean the last image, then it is inside the static mesh and there is no “GenerateOverlapEvents” checkbox there.

Because player should die only if he is attacked by an enemy. And only enemy who attacked has the link to player, not vice-versa.

The EndOverlap event would only be used to identify when the player leaves the volume, not to kill them. You would then have to trigger an event (an interface would be a good method) to tell your enemy to attack. Also you don’t need a reference to you player character if you are using a gameplay tag. You can also get this at any time using get player character or get player pawn.

1 Like

The new problems come. ActorBeginOverlap fires and sets the reference but it is immediately overwritten by None. The “Find in Blueprints” tool did not show another places where the zone reference is set. How to find them?

The enemy attacks the player before he leaves the zone.

The player character is not unique so “get player pawn” can return absolutely anything.

The only way I’ve been able to reproduce overlap not triggering on start is if the actors are streamed in, but guess it is not your case since you’ve said they’re placed in editor before start.

This is a quick test to get them to return something when streaming:

Wish I could be of more help.

1 Like

Some new details.
ActorBeginOverlap works only with the “outer” zone which is the root component of the zone blueprint. ComponentBeginOverlap works instead, and the reference is set, but at the very early time when the server is not listening yet and the actors are named in the toolbar “Actor (spawned)”, not “Actor (Server, spawned)”. The delays don’t help because the time of the start of the listening is unpredictable. SphereOverlapActors is now working, thanks!

1 Like

i dont think you’ll be able to find a universal solution. using custom collision you can target just that specific case, and then Actor Overlaps won’t trigger when you don’t want them to.

Unfortunately, I cannot use custom collision channels to the right and left, because I am planning a very large project with many unpredictable features whereas collision are not unlimited.