Assign NakatomiCMC in BeginPlay and add getter

This commit is contained in:
baz 2024-01-04 20:31:33 +00:00
parent 6bccd097bb
commit 08fbe9dbe1
2 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,8 @@ void ANakatomiCharacter::BeginPlay()
Super::BeginPlay();
SetInventoryToDefault();
NakatomiCMC = Cast<UNakatomiCMC>(GetCharacterMovement());
}
// Called every frame
@ -237,6 +239,11 @@ void ANakatomiCharacter::PushThrowableToInventory(TSubclassOf<AThrowable> Throwa
}
}
UNakatomiCMC* ANakatomiCharacter::GetCharacterMovementComponent()
{
return NakatomiCMC;
}
void ANakatomiCharacter::CalculateHits(TArray<FHitResult>* hits)
{
}

View File

@ -104,6 +104,8 @@ public:
void PushThrowableToInventory(TSubclassOf<AThrowable> Throwable);
UNakatomiCMC* GetCharacterMovementComponent();
protected:
virtual void CalculateHits(TArray<FHitResult>* hits);