Hello, I have a very simple line trace in my Actor Tick function:
FHitResult outHit;
FVector Start = PromptLocation->GetComponentLocation();
FVector End = DerrickCharacter->GetActorLocation();
TArray<AActor*> actorsToIgnore;
bool bHit = UKismetSystemLibrary::LineTraceSingle(GetWorld(), Start, End, UEngineTypes::ConvertToTraceType(ECC_Visibility), false, actorsToIgnore, EDrawDebugTrace::ForOneFrame, outHit, true);
And this is the function Syntax from the Unreal Docs:
static bool LineTraceSingle
(
const UObject * WorldContextObject,
const FVector Start,
const FVector End,
ETraceTypeQuery TraceChannel,
bool bTraceComplex,
const TArray< AActor * > & ActorsToIgnore,
EDrawDebugTrace::Type DrawDebugType,
FHitResult & OutHit,
bool bIgnoreSelf,
FLinearColor TraceColor,
FLinearColor TraceHitColor,
float DrawTime
)
Everything works well, except that the bIgnoreSelf argument which I set to âtrueâ is not working. When the line trace goes through itâs own Static Mesh it detects a hit.
Keep in mind that the same exact code in Blueprint works perfectly. The line trace doesnât detect a hit when going through the Static Mesh (when Ignore Self is ticked)
Hereâs how it looks in game:
Does anyone have any idea?