Solved movement and basic replication #1

Merged
Keeper317 merged 6 commits from multiplayerv2 into main 2025-11-23 03:22:15 +00:00
2 changed files with 56 additions and 2 deletions
Showing only changes of commit a59399ebfe - Show all commits

View File

@@ -2,6 +2,8 @@
#include "DDIPlayerController.h" #include "DDIPlayerController.h"
#include "DDICharacter.h"
#include "EnhancedInputSubsystems.h" #include "EnhancedInputSubsystems.h"
#include "Engine/LocalPlayer.h" #include "Engine/LocalPlayer.h"
#include "InputMappingContext.h" #include "InputMappingContext.h"
@@ -19,3 +21,20 @@ void ADDIPlayerController::BeginPlay()
} }
} }
void ADDIPlayerController::SetupInputComponent()
{
// Super::SetupInputComponent();
}
void ADDIPlayerController::OnPossess(APawn* InPawn)
{
Super::OnPossess(InPawn);
// is this a shooter character?
if (ADDICharacter* DDICharacter = Cast<ADDICharacter>(InPawn))
{
// add the player tag
DDICharacter->Tags.Add(PlayerPawnTag);
}
}

View File

@@ -13,10 +13,45 @@ UCLASS()
class OPENCONFLICT_API ADDIPlayerController : public APlayerController class OPENCONFLICT_API ADDIPlayerController : public APlayerController
{ {
GENERATED_BODY() GENERATED_BODY()
/*UPROPERTY and UFUNCTION declarations*/
private:
/*Properties*/
virtual void BeginPlay() override; /*Functions*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta=(AllowPrivateAccess=true)) protected:
/*Properties*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Shooter", meta = (AllowPrivateAccess = "true"))
TArray<class UInputMappingContext*> MappingContexts; TArray<class UInputMappingContext*> MappingContexts;
UPROPERTY(EditAnywhere, Category="Shooter")
FName PlayerPawnTag = FName("Player");
/*Functions*/
public:
/*Properties*/
/*Functions*/
/*C++ only declarations*/
private:
/*Properties*/
/*Functions*/
protected:
/*Properties*/
/*Functions*/
virtual void SetupInputComponent() override;
virtual void BeginPlay() override;
virtual void OnPossess(APawn *InPawn) override;
public:
/*Properties*/
/*Functions*/
}; };