It has both of those as well, but SetUsername_Implementation is still not recognized as a definition of SetUsername. Here are complete copies of both files to help. Thank you so much to everyone for working with me.
.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "AurorisNetworkTest4Character.h"
#include "Containers/UnrealString.h"
#include "CustomThirdPersonCharacter2.generated.h"
UCLASS()
class AURORISNETWORKTEST4_API ACustomThirdPersonCharacter2 : public ACharacter
{
GENERATED_BODY()
public:
// Sets default values for this character's properties
ACustomThirdPersonCharacter2();
UPROPERTY(EditAnywhere)
bool IsLocalPlayer;
UPROPERTY(Replicated, EditAnywhere)
FString PlayerUsername;
UPROPERTY(EditAnywhere)
class ACustomThirdPersonCharacter2* LocalPlayer;
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
// Called to Determine what player belongs to the local client
void LocalPlayer_GetStatus();
UFUNCTION(Server, Reliable)
void SetUsername(const FString& Username);
};
.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "CustomThirdPersonCharacter2.h"
#include "Kismet/GameplayStatics.h"
#include "AurorisGameInstance.h"
#include "Containers/UnrealString.h"
// Sets default values
ACustomThirdPersonCharacter2::ACustomThirdPersonCharacter2()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
}
// Called when the game starts or when spawned
void ACustomThirdPersonCharacter2::BeginPlay()
{ Super::BeginPlay();
LocalPlayer_GetStatus();
if (IsLocalPlayer == true) {
[INDENT=2]UAurorisGameInstance* AurorisGameInstance = Cast<UAurorisGameInstance>(GetGameInstance());[/INDENT]
[INDENT=2]SetUsername(AurorisGameInstance->ClientUsername);[/INDENT]
}
}
// Called every frame
void ACustomThirdPersonCharacter2::Tick(float DeltaTime)
{ Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ACustomThirdPersonCharacter2::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{ Super::SetupPlayerInputComponent(PlayerInputComponent);
}
// Called to Determine what player belongs to the local client
void ACustomThirdPersonCharacter2::LocalPlayer_GetStatus() { if (IsLocallyControlled()) {
[INDENT=2]IsLocalPlayer = true;[/INDENT]
}
else {
[INDENT=2]IsLocalPlayer = false;[/INDENT]
[INDENT=2]TArray<AActor*> FoundActors;[/INDENT]
[INDENT=2]UGameplayStatics::GetAllActorsOfClass(GetWorld(), ACustomThirdPersonCharacter2::StaticClass(), FoundActors);[/INDENT]
[INDENT=2]for (int i = 0; i < FoundActors.Num(); i++) {[/INDENT]
[INDENT=3]ACustomThirdPersonCharacter2* actor = Cast<ACustomThirdPersonCharacter2>(FoundActors*->GetClass());[/INDENT]
[INDENT=3]if (actor->IsLocalPlayer == true) {[/INDENT]
[INDENT=4]LocalPlayer = actor;[/INDENT]
[INDENT=3]}[/INDENT]
[INDENT=2]}[/INDENT]
}
}
void ACustomThirdPersonCharacter2::SetUsername_Implementation(const FString& Username)
{ PlayerUsername = Username;
}