Skip to main content

NPC Spawn

The NPC spawn is a child actor of the NPC Spawner.

It handles the properties of which actor to spawn, where and what they do.

npc-spawn.webp

Creating a new NPC spawn

To create a new NPC spawn, select the NPC Spawner that will control it and click the Create NPC Spawn button.

npc-spawn-button.webp

Now, in the list of children for this Spawner, you will see your new capsule for your spawn.

npc-spawn-new.webp

NPC Spawn Properties

NameTypeDescription
UntetherDistancefloatNPCs within this range of the player wont get despawned; we'll instead tether them to the player
bDontSpawnIfPreviouslyKilledboolThe name of this NPC. Will be used for the interaction and navigation markers.
NPCToSpawnTObjectPtr<class NPCDefinition>The NPC we want the spawn to spawn in
SpawnParamsFNPCSpawnParamsOptional spawn params we can use in the spawning process
OptionalGoalTObjectPtr<UNPCGoalItem>Optional goal to assign to the NPC when it spawns in
NPCSaveGUIDFGuidThe save GUID to assign to the NPC, so that its stats, items, etc are saved. You only need to set this if the NPC is non-unique and you actually want it to save.
bWasKilledboolWhether the NPC this spawn created has been killed in the past. If they were we shouldn't spawn them
bTetheredToPlayerboolWhether the NPC was tethered to the player

NPC Spawn Params

This struct defines optional overrides to control how an NPC should be spawned. It supports selectively overriding various attributes like name, level, appearance, item loadout, and more.

Property NameTypeDescription
bOverride_NPCNameuint8 (bitfield)Whether to override the default NPC name.
NPCNameFTextThe name to give the NPC if bOverride_NPCName is enabled.
bOverride_LevelRangeuint8 (bitfield)Whether to override the default NPC level range.
MinLevelint32The minimum level the NPC can spawn at, if bOverride_LevelRange is enabled.
MaxLevelint32The maximum level the NPC can spawn at, if bOverride_LevelRange is enabled.
bOverride_DefaultFactionsuint8 (bitfield)Whether to override the NPC's default factions.
DefaultFactions[FGameplayTagContainer](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/GameplayTags/FGameplayTagContainer)The factions this NPC should belong to by default if bOverride_DefaultFactions is enabled.
bOverride_DefaultOwnedTagsuint8 (bitfield)Whether to override the tags the NPC owns by default.
DefaultOwnedTags[FGameplayTagContainer](https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/GameplayTags/FGameplayTagContainer)Tags the NPC will have on spawn (e.g., State.Invulnerable or LockMovement) if bOverride_DefaultOwnedTags is enabled.
bOverride_ActivityConfigurationuint8 (bitfield)Whether to override the default activity configuration.
ActivityConfigurationTSoftObjectPtr<UNPCActivityConfiguration>The activity configuration that defines the NPC's behavior and schedule, if bOverride_ActivityConfiguration is enabled.
bOverride_DefaultItemLoadoutuint8 (bitfield)Whether to override the default items the NPC spawns with.
DefaultItemLoadoutTArray<FLootTableRoll>The items to give the NPC at spawn if bOverride_DefaultItemLoadout is enabled.
bOverride_DefaultAppearanceuint8 (bitfield)Whether to override the NPC's default appearance.
DefaultAppearanceTSoftObjectPtr<UCharacterAppearanceBase>The visual appearance of the NPC if bOverride_DefaultAppearance is enabled.
bOverride_TriggerSetsuint8 (bitfield)Whether to override the trigger sets assigned to the NPC.
TriggerSetsTArray<TSoftObjectPtr<UTriggerSet>>A list of trigger sets the NPC should use if bOverride_TriggerSets is enabled.