When i do this line trace on Client it works fine but when called on server the trace goes in horisontal line not where the camera is pointing is this because something needs to be Replicated
void ACharacter1::Function2_Implementation()
{
FVector Start = CameraComponent->GetComponentLocation();
FVector ForwardVector = CameraComponent->GetForwardVector();
FVector End = (ForwardVector * 5000) + Start;
FCollisionQueryParams CollisionQueryParams;
FHitResult HitResult;
CollisionQueryParams.AddIgnoredActor(this);
if (GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECC_GameTraceChannel2, CollisionQueryParams))
{
DrawDebugLine(GetWorld(), Start, HitResult.ImpactPoint, FColor::Red, false, 3.0f, 0, 5.0f);
if (AActor* Actor = HitResult.GetActor())
{
if (ACharacter* Player = Cast<ACharacter>(Actor))
{
CallDamage(30.f, Player);
}
}
}
}