in Lecture 109 we used if statements to check whether the PressurePlate is assigned or Null,
Why Can’t we use a Try-Catch Block Around the code to handle the exception instead of checking the condition?
is using if condition a better choice
try
{
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
{
OpenDoor(DeltaTime);
}
}
catch (const std::exception&)
{
UE_LOG(LogTemp, Error, TEXT("ActorThatOpens is Null"));
}`Preformatted text`
i don't know how to exactly implement try-catch in UE4 but used to use this in android apps.