diff --git a/Content/Blueprints/Characters/Player/BP_ExoPlayerCharacter.uasset b/Content/Blueprints/Characters/Player/BP_ExoPlayerCharacter.uasset index 1ef6fd7..641feaa 100644 Binary files a/Content/Blueprints/Characters/Player/BP_ExoPlayerCharacter.uasset and b/Content/Blueprints/Characters/Player/BP_ExoPlayerCharacter.uasset differ diff --git a/Source/Exo/Private/Characters/ExoPlayerCharacter.cpp b/Source/Exo/Private/Characters/ExoPlayerCharacter.cpp index 3bdcc61..65c2dd0 100644 --- a/Source/Exo/Private/Characters/ExoPlayerCharacter.cpp +++ b/Source/Exo/Private/Characters/ExoPlayerCharacter.cpp @@ -2,12 +2,19 @@ #include "Characters/ExoPlayerCharacter.h" + +#include "Characters/Components/ShootingComponent.h" #include "GameFramework/CharacterMovementComponent.h" +#include "Player/InteractionComponent.h" AExoPlayerCharacter::AExoPlayerCharacter() { GetCharacterMovement()->bSnapToPlaneAtStart = true; + InteractionComponent = CreateDefaultSubobject(TEXT("Interaction Component")); + + ShootingComponent = CreateDefaultSubobject(TEXT("Shooting Component")); + bUseControllerRotationPitch = true; bUseControllerRotationYaw = true; bUseControllerRotationRoll = false; @@ -16,5 +23,5 @@ AExoPlayerCharacter::AExoPlayerCharacter() void AExoPlayerCharacter::BeginPlay() { Super::BeginPlay(); - + check(InteractionComponent && ShootingComponent); } diff --git a/Source/Exo/Private/Player/ExoPlayerController.cpp b/Source/Exo/Private/Player/ExoPlayerController.cpp index f818b26..143fc80 100644 --- a/Source/Exo/Private/Player/ExoPlayerController.cpp +++ b/Source/Exo/Private/Player/ExoPlayerController.cpp @@ -31,7 +31,7 @@ void AExoPlayerController::BeginPlay() InteractionComponent = PlayerCharacter->FindComponentByClass(); ShootingComponent = PlayerCharacter->FindComponentByClass(); - // Ustawianie w komponencie poruszania prędkości zapisanej w characterze + // Ustawianie w komponencie poruszania prďż˝dkoďż˝ci zapisanej w characterze PlayerCharacter->GetCharacterMovement()->MaxWalkSpeed = PlayerCharacter->WalkSpeed; } diff --git a/Source/Exo/Public/Characters/ExoPlayerCharacter.h b/Source/Exo/Public/Characters/ExoPlayerCharacter.h index a4e0388..5c290f0 100644 --- a/Source/Exo/Public/Characters/ExoPlayerCharacter.h +++ b/Source/Exo/Public/Characters/ExoPlayerCharacter.h @@ -6,6 +6,9 @@ #include "Characters/ExoCharacterBase.h" #include "ExoPlayerCharacter.generated.h" +class UInteractionComponent; +class UShootingComponent; + UCLASS() class EXO_API AExoPlayerCharacter : public AExoCharacterBase { @@ -14,6 +17,12 @@ class EXO_API AExoPlayerCharacter : public AExoCharacterBase public: AExoPlayerCharacter(); + UPROPERTY(VisibleAnywhere, BlueprintReadOnly) + TObjectPtr InteractionComponent; + + UPROPERTY(VisibleAnywhere, BlueprintReadOnly) + TObjectPtr ShootingComponent; + UPROPERTY(EditAnywhere, Category = "Dodge Properties") float DodgeForce = 5000.f;