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 we work almost purely in blueprints, just several things done in C++, nothing related to collisions or overlapping ofc.
Hi, I’ve just reproduced it in much simpler project, so I will write whole procedure.
Steps to reproduce:
Create new TopDown blueprint-only project
Create Collectable blueprint - with Actor as parent
Add SphereCollision to Collectable. OnBeginOverlap of it with TopDownCharacter print some debug msg & destroy Collectable; Add some visual representation of it.
Add CollectableContainer blueprint with Actor as parent; add some visual representation (other that to Collectable)
Add ChildActorComponent to CollectableContainer & set its class as Collectable
Move the map a little bit down from its default position and mark where (0,0,0) point is, to make life easier.
Under some key add SpawnActorFromClass(CollectableContainer), obviously in other location than (0,0,0)
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 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.
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]