Have you tried enabling this in the Class Defaults?
Just tried it, no change, still no overlap on spawn after load.
I also tried moving along the X-axis with 1 and with 10, I tried âSet Collission Enabledâ on load, and I tried âIs Overlapping Actorâ, no solution yet âŚ
Hello, faced same problem here is the solution: set in collision presets ignore the object you need, for me it was pawn, and then in begin play set collision response to channel to overlap.
This is actually not a working solution, the proper way to do it would be to use GetOverlappingComponents which detects components/actors that are inside your collider instantly.
If you want to detect Overlaps on existing actors you need to use the function GetOverlappingComponents from your collider. ( GetOverlappingActors does not work because it only returns actors that have newly entered the collision volume since the last frame ).
On the receiver actors make sure you have another component (for example the Mesh) with GenerateOverlapEvents set to true and the collision channel set to âCharacterMeshâ.
Then on loop through the elements returned by GetOverlappingComponents, get the owner actor of the overlapped component and process what you want to do with it.
I see this thread is pretty fresh and Iâve just fased with this issue in similar case. My procedural mesh ignored character on spawn. The working solution for me is updating overlaps as for procedural mesh, as characters I want to check. I see UpdateOverlaps is not BP exposed function, so C++ is required
ProceduralMeshComponent->UpdateOverlaps();
FVector origin = GetActorLocation();
TArray<AActor*> foundActors;
UGameplayStatics::GetAllActorsOfClass(this, ACharacter::StaticClass(), foundActors);
// Iterate over the found actors and check their distance to the given location
for (AActor* foundActor : foundActors) {
// Calculate the distance between the actor and the specified location
float distanceToActor = FVector::Distance(foundActor->GetActorLocation(), origin);
if (distanceToActor <= Radius + 200) {
if(auto character = Cast<ACharacter>(foundActor)) {
character->UpdateOverlaps();
}
}
}
Thanks! your suggestion is the only one that worked for me.
In my case I needed the FHitResult.Item which stores the index for instanced static mesh components, which you donât get from a GetOverlappedActors() or a GetOverlappedComponents.
Tried getting the index from a GetInstancesOverlappingBox but that would not match my original primitive collision and therefore the begin and end overlap events wouldnât be correct.
And UpdateOverlaps() is not doing anything in my case.
I have the same problem, i have an aura which if i activate and the actors are awready in it then they need to go out and back in to apply the effect. I tried to change get overlapping actor to get overlapping components and i checked that the actors mesh âgenerate overlap eventsâ but it still do not register them if the aura spawn when they are awready in it and has again to get out and back in for it to work is there anything i am missing for this to work?
I awso tried this one but it has the same effect and is not working for me
if itâs simple shape,you could use sphere trace,box trace.they are almost the same with collision box.
You mean a sphere trace to check if someone is in there ? Sounds pretty good acctually. I will try it out and see if i can make it.
The shape is different depending on the enemy actor. Some are small and some big ones ^^
the size doesnât matter,you can always adjust the trace radius.
I donât know why but it fails to find any actor. I can clearly see the debug lines of the sphere trace overlapping the actor⌠(the tag is awso spelled correctly it works further down there on the code on begin overlapâŚActor awso blocks visibility in collision settings)
and i put here 2 boxes to calculate the distance between this auraâŚ
Am i doing it wrong ? It aways print string the fail oneâŚ
I found some work around. First of all i do have a skill where i spawn a sphere collision and if i spawn it on an actor inside of it then it register the overlap. So not sure why this skill works as intendet. Anyway the difference on this one vs my aura is that the aura is on the player character and it only gets activated where the other skill spawns a completely new actor in the world. So spawning the aura does seem to work and registering actors awready inside of it. Now i changed the aura as well to spawn in the world and not anymore be inside the player character and this seems to fix itâŚ
This doesnât work for me. Hereâs what I did to test:
Function library:
void BlueprintFunctionLibrary::UpdateOverlaps(AActor* Actor) {
Actor->UpdateOverlaps();
}
Then in blueprints:
When the boxes are overlapping and I press play, it doesnât trigger the event:
The event gets triggered only after I move them manually out and then in: