[Solved] How to typecast TSubclassOf<>?

Got ya! Yeah, it looks like you do want TSubclassOf (sorry I didn’t fully understand what you were trying to do before). Here, let me suggest trying this:

if (Item->IsChildOf(AShooterWeapon::StaticClass()))
{
	TSubclassOf<AShooterWeapon> WeaponClass = *Item;
	CanPickupAmmo(WeaponClass);
}

Hopefully this helps! - Mike (Epic Games)

4 Likes