The Resource Component: Harvestable Actors and the NavMesh Gotcha
How a Resource component marks an actor as harvestable in Unreal Engine: a Sphere component that doubles as the overlap trigger and extraction timer, a replicated extraction count that destroys the actor when depleted, and the Can Ever Affect Navigation trap that stops a worker reaching it.
A harvestable actor is just an actor with a Resource component on it. That one component
makes a tree or a rock something a worker can detect, harvest over time, and use up. This
card covers UResourceComponent and the two gotchas that trip up every first run:
navigation and replication. It is part of
Resource Gathering AI in Unreal Engine and
pairs with the Gatherer component, which
searches for it by tag.

A sphere that is also the timer
The component is a USphereComponent subclass, which is the neat trick: the same object is
both the proximity trigger and the harvest logic.
UCLASS(Blueprintable, ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class RESOURCEGATHERER_API UResourceComponent : public USphereComponent
{
UPROPERTY(EditAnywhere, Category = "Resource Gathering Settings")
FGameplayTag ResourceTag;
UPROPERTY(ReplicatedUsing=OnRep_ExtractionsRemaining, EditAnywhere, Category = "Resource Gathering Settings")
int32 ExtractionsRemaining = 3;
UPROPERTY(EditAnywhere, Category = "Resource Gathering Settings")
float ExtractTimeInSeconds = 4.f;
};
The sphere generates the overlap that the worker’s capsule reacts to, so set its radius a
little larger than the mesh, otherwise the worker can run into the trunk without ever
“arriving”. The ResourceTag is the label the worker’s search matches (see
Assignments and Gameplay Tags). The
two numbers are the whole economy of one node: how many times it can be harvested, and how
long each harvest takes.
Extraction is a server timer
When the worker arrives and asks to harvest, the component starts a timer and hands back a delegate the Gatherer listens to:
bool UResourceComponent::TryBeginExtraction(FOnExtractionComplete*& OutExtractionDelegate)
{
if (!GetOwner()->HasAuthority() || ExtractionsRemaining == 0) return false;
GetWorld()->GetTimerManager().SetTimer(
ExtractionTimerHandle, this, &UResourceComponent::CompleteExtraction,
ExtractTimeInSeconds, false);
OutExtractionDelegate = &OnExtractionComplete;
return true;
}
This is why the Behavior Tree’s extract task has to wait: nothing has been harvested when
TryBeginExtraction returns, only scheduled. The task keeps running until the delegate
fires ExtractTimeInSeconds later.

When the timer fires, the component broadcasts completion, decrements the count, and destroys the actor if it is spent:
void UResourceComponent::CompleteExtraction()
{
if (!OwnerActor || !OwnerActor->GetIsReplicated())
{
UE_LOG(LogTemp, Error, TEXT("Owner actor is not replicated; cannot destroy on clients."));
return;
}
OnExtractionComplete.Broadcast();
ExtractionsRemaining--;
if (ExtractionsRemaining == 0) GetOwner()->Destroy();
}
The count is ReplicatedUsing=OnRep_ExtractionsRemaining, so clients also destroy the actor
the moment it hits zero, keeping every machine’s world in sync.
Gotcha one: replication
Notice the guard at the top of CompleteExtraction. If the resource actor is not
replicated, the component cannot tell clients to destroy it, so it refuses and logs. On the
first run of a fresh setup this is the classic symptom: the worker reaches the tree, the
extract task spins, and nothing finishes. The Output Log says exactly why, tick
Replicates on the resource actor, and it works.

Gotcha two: navigation
The second trap is that the worker stops short of the resource and never overlaps it. The cause is navigation: by default a static mesh affects the NavMesh, so the walkable surface is carved out around your resource and the path ends just outside it. The search even filters resources by reachability:
if (!IsNavigablePath(GetOwner()->GetActorLocation(), Actor->GetActorLocation())) continue;
so a carved-out resource may not even be considered. The fix is to open the resource’s mesh and turn off Can Ever Affect Navigation, and to make sure the map has a NavMesh at all (press P in the viewport; the floor turns green).

What to take away
UResourceComponentis a Sphere component, so one object is both the overlap trigger and the extraction timer. Size the sphere past the mesh.ExtractionsRemainingandExtractTimeInSecondsset yield and pace; the replicated count destroys the actor on every machine when depleted.- The two first-run failures are a non-replicated resource actor (extraction never finishes) and a mesh that affects navigation (the worker cannot reach it). The Output Log flags the first; the green NavMesh check flags the second.
Next, follow what spawns when extraction finishes in The carried resource, or read the full ownership story in Multiplayer. The packaged system is Resource Gathering Minions on FAB.
Frequently asked questions
- Why is the Resource component a Sphere component?
- So it is both the trigger and the timer in one. Being a USphereComponent, it generates the overlap that lets the worker's capsule detect it has reached the resource; being the resource logic, it holds the extraction timer and remaining-yield count. Size the sphere a little larger than the mesh so the worker actually overlaps it.
- How do I set how much a resource yields and how long it takes?
- On the Resource component, set Extractions Remaining (how many harvests before the actor is used up, default 3) and Extract Time In Seconds (how long one harvest takes, default 4). When the count reaches zero the actor destroys itself.
- Why does my worker stop short of the resource and never reach it?
- The resource's static mesh is carving the NavMesh. By default a static mesh affects navigation, so the walkable area is cut out around the resource and the path ends before it. Open the mesh and turn off Can Ever Affect Navigation, and make sure the map has a NavMesh (press P to see it).
- Why does extraction finish but nothing happens on clients?
- The resource actor is not replicated. The remaining-extraction count is a replicated property, and the component logs an error and bails if its owner is not replicated, because it cannot tell clients to destroy the actor. Tick Replicates on the resource actor.