Update Control Rig to Use Inverse Kinematics

This commit is contained in:
Philip W 2023-10-16 14:34:48 +01:00
parent d932cd7e70
commit 975818c157
5 changed files with 15 additions and 6 deletions

Binary file not shown.

View File

@ -59,10 +59,15 @@ void AEnemyCharacter::SetLocalAlertLevel(int NewAlertLevel) const
DelegatedControlHub->SetAlertLevel(NewAlertLevel); DelegatedControlHub->SetAlertLevel(NewAlertLevel);
} }
void AEnemyCharacter::EquipWeapon_Implementation()
{
}
void AEnemyCharacter::HuntPlayer(FVector PlayerLastKnownLocation) void AEnemyCharacter::HuntPlayer(FVector PlayerLastKnownLocation)
{ {
if (!IsValid(this)) return; if (!IsValid(this)) return;
if (!IsValid(GetController())) return; if (!IsValid(GetController())) return;
SetAlertLevel(2); SetAlertLevel(2);
EquipWeapon();
Cast<AAIController>(GetController())->GetBlackboardComponent()->SetValueAsVector("LastKnownLocation", PlayerLastKnownLocation); Cast<AAIController>(GetController())->GetBlackboardComponent()->SetValueAsVector("LastKnownLocation", PlayerLastKnownLocation);
} }

View File

@ -29,6 +29,10 @@ public:
void SubscribeToGroupAIEvents(class AAIControlHub* ControlHub); void SubscribeToGroupAIEvents(class AAIControlHub* ControlHub);
void SetLocalAlertLevel(int NewAlertLevel) const; void SetLocalAlertLevel(int NewAlertLevel) const;
UFUNCTION(BlueprintNativeEvent)
void EquipWeapon();
virtual void EquipWeapon_Implementation();
private: private:
FDelegateHandle AlertLevelDelegateHandle; FDelegateHandle AlertLevelDelegateHandle;
FDelegateHandle HuntPlayerDelegateHandle; FDelegateHandle HuntPlayerDelegateHandle;