GameState Component
UEDInteractionGameStateComponent is a server-authoritative component designed to be attached to your GameState.
Header:
Source/EDInteractionSystem/Public/Components/EDInteractionGameStateComponent.h
It is responsible for:
- Loading foliage interaction configuration into a server-side lookup map
- Replicating removed foliage instances using a FastArraySerializer
- Spawning foliage destruction effects
- Playing destruction/interaction sounds via multicast
- Scheduling and executing respawn of removed foliage instances
Required setup
- Create/choose a GameState class (Blueprint or C++).
- Add the component
UEDInteractionGameStateComponent. - Ensure your GameMode uses that GameState.
Replicated data
The component replicates:
RemovedFoliageInstances(FEDRemovedFoliageInstanceList)
Clients react to replication events to remove instances locally.
Foliage interaction entry point
The main server entry point for foliage is:
InteractWithFoliageInstance(...)
It can either:
- Remove the instance and spawn effects/sounds directly, or
- Replace the instance with a spawned actor (
AEDFoliageToInteractableActor) when HitPoints behavior is required.