TArray of FHitResoult On Server - distance always return 0

anonymous_user_b5c9f6eb
Mon, 30 Nov 2015 09:36:08 +0000
World Creation

Hi, I’m working on ShooterGame Project in UE 4.10.

After sending a TArray to a Server function all distances in array get a value of 0. I don’t know if it’s bug or I’m doing something wrong.

GetActor() returns local and on serwer always actor that was hit.

Thanks for answer!

Function On Server (Impact isn’t modified)

UFUNCTION(reliable, server, WithValidation)
	void ServerNotifyHit( const TArray<FHitResult>& Impact, FVector_NetQuantizeNormal ShootDir, int32 RandomSeed, float ReticleSpread);

void AShooterWeapon_Instant::ServerNotifyHit_Implementation(const TArray<FHitResult>& Impact, FVector_NetQuantizeNormal ShootDir, int32 RandomSeed, float ReticleSpread)

Debug Code:

switch (Role)
	{
	case ROLE_Authority:
		roleStr = "Authority";
		break;
	case ROLE_AutonomousProxy:
		roleStr = "AutonomousProxy";
		break;
	case ROLE_SimulatedProxy:
		roleStr = "SimulatedProxy";
		break;
	default:
		roleStr = "Other!";
		break;
	}

	for (int i = 0; i < Impact.Num(); i++)
	{
		GEngine->AddOnScreenDebugMessage(-1, 5.0, FColor::Green, "i=" + FString::FromInt(i) + ", Dystans: " + FString::SanitizeFloat(Impact[i].Distance) + " ROLE: " + roleStr );
	}

1 post - 1 participant