Context
I am placing area damaging actors, which damages pawns as they trigger an overlap event. That is done not directly, but instead the overlap gets a status effects component of the pawn, telling it to add a new key value pair to a map. The key is the area actor (as UObject class). When the pawn leaves the volume, the area actor removes the effect.
Issue
While overlapping a few area actors simultaniously seems to be fine, overlapping several causes a crash, seemingly when exiting the volumes.
Debugging
The first step in debugging this, I have created a fresh FPS project and in the player character setup a way to directly spawn the area actors and adding them to the status effects map, as well as removing them. Note that the overlap volume are of type vehicle, and is set to ignore vehicle so that they should not be triggering each other.
A very important note here is that I am simply spawning them and adding & removing them to the map - I am not actually ever triggering their overlaps, leading me to think it is a map problem.
Project
Using Project & Information
FirstPersonCharacter contains the logic for spawning the area actors and passing them to the status effects component. The N variable determines how many to spawn each time.
StatusEffectsComponent contains methods for adding to and removing from the map. There’s an Enum “Use Type” to determine if UObject, Actor or Name should be used and can be switched between freely between simulations. I can’t tell if the different map type used has different crashing results or not.
It also has a tick which constantly applies damage to the pawn for each key, but that happens silently.
Gun can be fired to shoot a projectile which spawns area actors each collision.
Area actors are placed in groups in the map for testing overlap.
E - spawns area actors and tells the status effects component to add them.
R - iterates over all spawned area actors, tells the status effects component to remove them and then calls their destroy function. then clears the array.
T - prints information about the selected map.
causing a crash
- Press E. Press R. Repeat up to 5 times and the project should crash, it does for me.
- Press E, walk over some area actors. It should crash, but it may depend of which map type is being used.