Collision/Overlapping on spawn problem

Hi, recently we’ve upgraded with team our project from UE 4.9 to UE4.12.2 and we experienced strange behavior of overlapping detection. Due to change of few versions in the same time it’s hard to determine if it’s strictly 4.12 problem or not.

We have procedurally generated map and our pawn always spawned in (x0;y0;z120) point. We’ve got a lot of collectables (collected on BeginOverlap with Pawn) on the map, and once new level was created - so that big chunk of level was spawned (using SpawnActor & collectables are ChildActorsComponents of spawned actors) at the same moment as pawn - all collectables that should be on this chunk were immediately collected by our hero.

I’ve made a little debugging, and it looks like all the objects’ collision is positioned in point (x0;y0;z0), or something like that. If pawn was spawned several metres over the map everything worked fine - collectables were spawned correctly on whole map and none was collected at the begining of new level.

Anybody else encountered this problem?

Our current workaround was to move whole map several thousand units up, and it works like a charm - but maybe this question will help some other developers who are struggling with similar problem; and obviously it would be nice to fix it in the engine if it’s not something wrong with our project :slight_smile: we work almost purely in blueprints, just several things done in C++, nothing related to collisions or overlapping ofc.

Hi ,

  • Are you spawning using blueprints or is this part of what is done in c++?
  • Where is your killz located? Is it far enough below the level to prevent the actors from overlapping?
  • Are you checking to ensure the overlapped actors are overlapping the player, not any actor?
  • Do you see any warnings when the error occurs?
  • Do you have the actors sweeping when placed? Are they possibly spawning within other actors?

Hi, I’ve just reproduced it in much simpler project, so I will write whole procedure.

Steps to reproduce:

  1. Create new TopDown blueprint-only project
  2. Create Collectable blueprint - with Actor as parent
  3. Add SphereCollision to Collectable. OnBeginOverlap of it with TopDownCharacter print some debug msg & destroy Collectable; Add some visual representation of it.
  4. Add CollectableContainer blueprint with Actor as parent; add some visual representation (other that to Collectable)
  5. Add ChildActorComponent to CollectableContainer & set its class as Collectable
  6. Move the map a little bit down from its default position and mark where (0,0,0) point is, to make life easier.
  7. Under some key add SpawnActorFromClass(CollectableContainer), obviously in other location than (0,0,0)
  8. Start game, go to point (0,0,0) and press key that spawns CollectableContainer

Expected result:

CollectableContainer spawns with Collectable in location set in key handling method

Actual result:

CollectableContainer spawns correctly; debug msg that Collectable was collected appears.

Additional data:

  • If you go away from (0,0,0) point everything spawns correctly.
  • If you make same operation but spawn Collectable directly - everything works fine, so it looks like it’s related to ChildActorComponent

I’ve got recently created similar project as described above, I can attach it with instruction if you want.

I attempted to follow the instructions listed here but thus far have been unable to reproduce the error, if you have a sample project this is occurring in I’ll be happy to take a look.

I can’t attatch it as even as 7zip it’s over 20mbs, so here it is:

https://dl.dropboxusercontent.com/u/15345883/Rage%20Disco/OverlappingProblem.7z

Tested on two PCs and on both this strange behavior is visible

Controls:

  • C to spawn Collectable only
  • V to spawn CollectableContainer
  • B to reset (remove all Collectable & CollectableContainer spawned so far)
  • (0,0,0) is on the square where you start the game

All keyboard bindings & spawning logic is done in level blueprint

I was able to reproduce this on my end and have entered a bug report, UE-32418, to be assessed by the development staff. As a workaround, add a delay of .01 seconds before the cast node, this gives the overlap time to register the casted actor.

So I noticed UE-32418 has been marked as fixed, but I’m still experiencing this issue on 4.15

Same problem. My spawned actors doesnt have the same collision as their base blueprint actor.

I dont change collision at all. I only select always spawn.

Must be a bug.strong text

SpawnActor in c++ does not respect collision profiles - class AHero is set to a channel which has overlap set in the preset, yet spawn still fails. UE 4.20.3

player = Cast(GetWorld()->SpawnActor(HeroCharacters[1]->GetDefaultObject()->GetClass(), &Location, &Rotation, SpawnInfo));

LogSpawn: Warning: SpawnActor failed because of collision at the spawn location [X=-46.849 Y=2.305 Z=-24.162] for [Deerdoe_C]