void SetFirstPerson(AHalfDeadCharacter* Player);
UFUNCTION(Server, Reliable, WithValidation)
void Server_SetFirstPerson(AHalfDeadCharacter* Player);
bool Server_SetFirstPerson_Validate(AHalfDeadCharacter* Player);
void Server_SetFirstPerson_Implementation(AHalfDeadCharacter* Player);
virtual void Tick(float DeltaTime) override;
void AHalfDeadCharacter::SetFirstPerson(AHalfDeadCharacter* Player1)
{
if (Player1->IsDefaultCamera == false) {
Player1->SetActorRotation(FRotator(0.f, Player1->FirstPersonCamera->GetComponentRotation().Yaw, Player1->GetActorRotation().Roll));
if (Player1->HasAuthority() == false) {
Server_SetFirstPerson(Player1);
}
}
}
void AHalfDeadCharacter::Server_SetFirstPerson_Implementation(AHalfDeadCharacter* Player)
{
Player->SetActorRotation(FRotator(0.f, Player->FirstPersonCamera->GetComponentRotation().Yaw, Player->GetActorRotation().Roll));
UE_LOG(LogTemp, Warning, TEXT("Client")); UE_LOG(LogTemp, Warning, TEXT("Client"));
}
bool AHalfDeadCharacter::Server_SetFirstPerson_Validate(AHalfDeadCharacter* Player)
{
return true;
}
void AHalfDeadCharacter::Tick(float DeltaTime)
{
SetFirstPerson(this);
}
The Problem is that the information from client doesnt share to the server.
i have already been solving this for a 2 hours. It is exactly like in the video.
Something wrong with the Server_SetFirstPerson_Implementation. UELOG is typing, but there is no changes on server