Linetrace not working in world composition level

TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
ObjectTypes.Add(EObjectTypeQuery::ObjectTypeQuery1); // Landscape
TArray<AActor*> ActorsToIgnore;
FHitResult OutHit;

bool bFound = UKismetSystemLibrary::LineTraceSingleForObjects(GetWorld(), GetActorLocation(), (GetActorLocation() + GetActorUpVector() * ToDist), ObjectTypes, false, ActorsToIgnore, EDrawDebugTrace::Persistent, OutHit, true);
    // more to do.. 
  • bFound is always false in World Composition Level in Play as Client only,
  • working well in World Composition Level Listen Server,
  • working well in normal level (non world composition) in Play as Client also.

This will work anywhere except in InitGame() function of gamemode class.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.