Here how you can cast and check validity of a cast :
if(auto Door = Cast<ADoor>(GetDoorInteractingWith())
{
Door->SpecialDoorMethod(); // here the object returned by GetDoorInteractingWith has been sucessfully casted to a door;
}
Here how you can cast and check validity of a cast :
if(auto Door = Cast<ADoor>(GetDoorInteractingWith())
{
Door->SpecialDoorMethod(); // here the object returned by GetDoorInteractingWith has been sucessfully casted to a door;
}