Updated TempCharacter to destory ammo ore
destroys ammo ore when the player presses e on it
This commit is contained in:
parent
43ef8e2110
commit
3c2d057951
@ -40,6 +40,8 @@ void ATempCharacter::BeginPlay()
|
|||||||
|
|
||||||
Enemy = TEXT("Enemy");
|
Enemy = TEXT("Enemy");
|
||||||
UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors);
|
UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors);
|
||||||
|
|
||||||
|
Ammo = TEXT("Ammo");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Binds the input we made in the setup player component to the forward vector
|
//Binds the input we made in the setup player component to the forward vector
|
||||||
@ -150,6 +152,10 @@ void ATempCharacter::LineTraceLogic()
|
|||||||
{
|
{
|
||||||
UE_LOG(LogTemp, Display, TEXT("Not Enough Gold"));
|
UE_LOG(LogTemp, Display, TEXT("Not Enough Gold"));
|
||||||
}
|
}
|
||||||
|
if(OutHit.GetActor()->ActorHasTag(Ammo))
|
||||||
|
{
|
||||||
|
OutHit.GetActor()->Destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// if the actor hit has the interaction component/script then it will activate the code
|
// if the actor hit has the interaction component/script then it will activate the code
|
||||||
|
|
||||||
|
@ -93,4 +93,6 @@ public:
|
|||||||
|
|
||||||
FName Enemy;
|
FName Enemy;
|
||||||
|
|
||||||
|
FName Ammo;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user