I was curious on how to cast a custom actor class? I can do with with characters, but not with actor classes. any Idea how to do this?
void AMyCustomCharacter::OnCollision(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
if ((OtherActor != NULL) && (OtherActor != this) && (OtherComp != NULL))
{
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Red, TEXT("I HIT THAT"));
AItem *Item = //NEED HELP HERE!!!-----------------------------------------------------------------------------
if (OtherActor == Item)
{
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Red, TEXT("ITEM"));
bCanPickUp = true;
}
else
{
bCanPickUp = false;
}
}
}
I have the first collision check working, just need to know how to cast the AWeapon actor :(.