Solved movement and basic replication #1
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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*/
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user