Updated TempCharacter to start fixing bugs
This commit is contained in:
parent
b0e9ad546b
commit
fc25c8adf0
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Azos.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Azos.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Eis.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Eis.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Iroquoid.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Iroquoid.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Probertium.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Items/ItemsInWorld/BP_Probertium.uasset
(Stored with Git LFS)
Binary file not shown.
@ -142,18 +142,31 @@ void ATempCharacter::LineTraceLogic()
|
|||||||
FVector End = Start + GlobalTrace * ThisCamera->GetForwardVector();
|
FVector End = Start + GlobalTrace * ThisCamera->GetForwardVector();
|
||||||
FCollisionQueryParams TraceParams;
|
FCollisionQueryParams TraceParams;
|
||||||
TraceParams.AddIgnoredActor(this);
|
TraceParams.AddIgnoredActor(this);
|
||||||
|
|
||||||
bHit = GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Pawn, TraceParams);
|
bHit = GetWorld()->LineTraceSingleByChannel(OutHit, Start, End, ECC_Pawn, TraceParams);
|
||||||
if (bHit)
|
if (bHit)
|
||||||
{
|
{
|
||||||
//we store the GetItem function from InventoryComponent into ItemArray variable
|
|
||||||
|
|
||||||
if (OutHit.GetActor() == nullptr)
|
if (OutHit.GetActor() == nullptr)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (OutHit.GetActor()->FindComponentByClass<UInventoryComponent>())
|
if (OutHit.GetActor()->FindComponentByClass<UInventoryComponent>())
|
||||||
{
|
{
|
||||||
|
if(OutHit.GetActor()->ActorHasTag(TEXT("Probertium")))
|
||||||
|
{
|
||||||
|
OutHit.GetActor()->Destroy();
|
||||||
|
}
|
||||||
|
else if(OutHit.GetActor()->ActorHasTag(TEXT("Iroquid")))
|
||||||
|
{
|
||||||
|
OutHit.GetActor()->Destroy();
|
||||||
|
}
|
||||||
|
else if (OutHit.GetActor()->ActorHasTag(TEXT("Azos")))
|
||||||
|
{
|
||||||
|
OutHit.GetActor()->Destroy();
|
||||||
|
}
|
||||||
|
else if (OutHit.GetActor()->ActorHasTag(TEXT("Eis")))
|
||||||
|
{
|
||||||
|
OutHit.GetActor()->Destroy();
|
||||||
|
}
|
||||||
UE_LOG(LogTemp, Display, TEXT("Hit Merchant"));
|
UE_LOG(LogTemp, Display, TEXT("Hit Merchant"));
|
||||||
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
auto ItemArray = OutHit.GetActor()->FindComponentByClass<UInventoryComponent>()->GetItem(0);
|
||||||
if (GoldBalance >= ItemArray->ItemCostPrice)
|
if (GoldBalance >= ItemArray->ItemCostPrice)
|
||||||
@ -166,10 +179,6 @@ 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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user