Error C2276: '!' : illegal operation on bound member function expression

Hey there!

I keep getting the following error

error C2276: '!' : illegal operation on bound member function expression

This occurs in the following section of code from the BatteryPickup tutorial:

void ATestProject::Interact()
{
	// Get all overlapping Actors and store them in a collected Actors array
	TArray<AActor*> CollectedActors;
	CollectionSphere->GetOverlappingActors(CollectedActors);

	// For each Actor collected
	for (int32 iCollected = 0; iCollected < CollectedActors.Num(); ++iCollected)
	{	
		// Cast the AActor to AItem to see if it's an AItem
		AItem* const Item = Cast<AItem>(CollectedActors[iCollected]);

		// Check to see if this is an AItem, and if it's not pending kill
		if (Item && !Item->IsPendingKill && Item->bIsActive)
		{ 
			ATestProject::PickUpItem(Item);
		}
	}
};

Any help pointing this noob in the right direction is greatly appreciated!

Thanks!

if (Item && !Item->IsPendingKill && Item->bIsActive)

if (Item && !Item->IsPendingKill() && Item->bIsActive)

?

Holy noob Batman!

I’m sure that’s what it was, but I’ll check it out tonight when I get home.

Thanks!

Yep, that was it! Thanks again!