Added SneakMechanicTesting level
Added new level for sneak mechanic testing
This commit is contained in:
parent
119b5a141a
commit
ce4f3aff1f
BIN
Content/BlueprintAI/AI/AIControllerBruh.uasset
(Stored with Git LFS)
BIN
Content/BlueprintAI/AI/AIControllerBruh.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Levels/Testing/SneakMechanicTesting.umap
(Stored with Git LFS)
Normal file
BIN
Content/Levels/Testing/SneakMechanicTesting.umap
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -36,11 +36,13 @@ void ATempCharacter::BeginPlay()
|
|||||||
|
|
||||||
//MAKE SURE POST PROCESSING IS IN THE SCENE OR GAME WILL CRASH
|
//MAKE SURE POST PROCESSING IS IN THE SCENE OR GAME WILL CRASH
|
||||||
UGameplayStatics::GetAllActorsOfClass(GetWorld(), APostProcessVolume::StaticClass(), AllActorsInScene);
|
UGameplayStatics::GetAllActorsOfClass(GetWorld(), APostProcessVolume::StaticClass(), AllActorsInScene);
|
||||||
PostProcessVolume = Cast<APostProcessVolume>(AllActorsInScene[0]);
|
|
||||||
|
|
||||||
Enemy = TEXT("Enemy");
|
Enemy = TEXT("Enemy");
|
||||||
UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors);
|
UGameplayStatics::GetAllActorsWithTag(GetWorld(), Enemy, AIActors);
|
||||||
|
//stops crashing
|
||||||
|
if (ensureMsgf(AllActorsInScene.Num() > 0, TEXT("No Post Processing Volume in scene")))
|
||||||
|
{
|
||||||
|
PostProcessVolume = Cast<APostProcessVolume>(AllActorsInScene[0]);
|
||||||
|
}
|
||||||
Ammo = TEXT("Ammo");
|
Ammo = TEXT("Ammo");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,14 +63,11 @@ void ATempCharacter::Sneak()
|
|||||||
if (bIsCrouched)
|
if (bIsCrouched)
|
||||||
{
|
{
|
||||||
UnCrouch();
|
UnCrouch();
|
||||||
PostProcessVolume->Settings.VignetteIntensity = 0.0f;
|
if (PostProcessVolume != nullptr) PostProcessVolume->Settings.VignetteIntensity = 0.0f;
|
||||||
for (AActor* Actor : AIActors)
|
for (AActor* Actor : AIActors)
|
||||||
{
|
{
|
||||||
USphereComponent* SphereComponent = Actor->FindComponentByClass<USphereComponent>();
|
USphereComponent* SphereComponent = Actor->FindComponentByClass<USphereComponent>();
|
||||||
if (SphereComponent != nullptr)
|
if (SphereComponent != nullptr) SphereComponent->SetSphereRadius(40.0f); //default value
|
||||||
{
|
|
||||||
SphereComponent->SetSphereRadius(40.0f); //default value
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -77,12 +76,9 @@ void ATempCharacter::Sneak()
|
|||||||
for (AActor* Actor : AIActors)
|
for (AActor* Actor : AIActors)
|
||||||
{
|
{
|
||||||
USphereComponent* SphereComponent = Actor->FindComponentByClass<USphereComponent>();
|
USphereComponent* SphereComponent = Actor->FindComponentByClass<USphereComponent>();
|
||||||
if (SphereComponent != nullptr)
|
if (SphereComponent != nullptr) SphereComponent->SetSphereRadius(15.0f);
|
||||||
{
|
|
||||||
SphereComponent->SetSphereRadius(15.0f);
|
|
||||||
}
|
}
|
||||||
}
|
if (PostProcessVolume != nullptr) PostProcessVolume->Settings.VignetteIntensity = 0.8f;
|
||||||
PostProcessVolume->Settings.VignetteIntensity = 0.8f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user