From 08fbe9dbe13996c269f315cc07f6c91eccead406 Mon Sep 17 00:00:00 2001 From: baz Date: Thu, 4 Jan 2024 20:31:33 +0000 Subject: [PATCH] Assign NakatomiCMC in BeginPlay and add getter --- Source/Nakatomi/NakatomiCharacter.cpp | 7 +++++++ Source/Nakatomi/NakatomiCharacter.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/Source/Nakatomi/NakatomiCharacter.cpp b/Source/Nakatomi/NakatomiCharacter.cpp index c60e675..4f1e224 100644 --- a/Source/Nakatomi/NakatomiCharacter.cpp +++ b/Source/Nakatomi/NakatomiCharacter.cpp @@ -25,6 +25,8 @@ void ANakatomiCharacter::BeginPlay() Super::BeginPlay(); SetInventoryToDefault(); + + NakatomiCMC = Cast(GetCharacterMovement()); } // Called every frame @@ -237,6 +239,11 @@ void ANakatomiCharacter::PushThrowableToInventory(TSubclassOf Throwa } } +UNakatomiCMC* ANakatomiCharacter::GetCharacterMovementComponent() +{ + return NakatomiCMC; +} + void ANakatomiCharacter::CalculateHits(TArray* hits) { } diff --git a/Source/Nakatomi/NakatomiCharacter.h b/Source/Nakatomi/NakatomiCharacter.h index 3aa1a0d..1951dc3 100644 --- a/Source/Nakatomi/NakatomiCharacter.h +++ b/Source/Nakatomi/NakatomiCharacter.h @@ -104,6 +104,8 @@ public: void PushThrowableToInventory(TSubclassOf Throwable); + UNakatomiCMC* GetCharacterMovementComponent(); + protected: virtual void CalculateHits(TArray* hits);