Am trying to arrow ovarlap with Roof to Restart my bool in my Character class to true to shoot my Arrow Again and sometime UE4 crashing pls help
If OtherActor
is an ARoof
you cast it to APlayerShooter
. I don’t think roof is a good player candidate :T
Dude can u help me ? cuz am rly stuck
Assuming APlayerShooter
is a APlayerController
, you are probably after something like this:
if( auto* roof = Cast<ARoof>(OtherActor) )
if( auto* player = Cast<APlayerShooter>(UGameplayStatics::GetPlayerController( GetWorld() , 0 )) )
{
player->bCanIShoot = true;
}
Where you check if that OtherActor
is a roof or not. And if check passes you get a pointer to instance of this APlayerShooter
actor and toggle it’s bCanIShoot
field.
thanks for answer