Skip to content

Mob Components

Overview

Mob components attach to AMIPBaseMob and provide base behavior, aggro sphere, movement, nameplate, and spawner placement. UMIPBaseMobComponent is a minimal base that exposes GetBaseMob(). UMIPMobAggroNearbyPlayerSphere is a sphere component for aggro range. UMIPMobCharacterMovementComponent customizes mob movement. UMIPMobNameplateWidgetComponent is a widget component for the mob nameplate. UMIPMobPlayerStartComponent is a spawner component that places mobs (like a PlayerStart for mobs).

Key traits:

  • UMIPBaseMobComponent – Base for mob logic; subclasses add health (UMIPMobHealthComponent), loot, etc.
  • UMIPMobHealthComponent – See Health; initializes when mob calls it; on death gives EXP and loot.
  • Aggro, movement, nameplate, and spawner are optional per-mob setup.

All paths below are relative to Plugins/ModularInventoryPlus/Source/ModularInventoryPlus/.


Key Classes & Files

Class File
UMIPBaseMobComponent Public/Mob/Components/MIPBaseMobComponent.h
UMIPMobAggroNearbyPlayerSphere Public/Mob/Components/MIPMobAggroNearbyPlayerSphere.h
UMIPMobCharacterMovementComponent Public/Mob/Components/MIPMobCharacterMovementComponent.h
UMIPMobNameplateWidgetComponent Public/Mob/MIPMobNameplateWidgetComponent.h
UMIPMobPlayerStartComponent Public/Mob/Spawners/MIPMobPlayerStartComponent.h

UMIPBaseMobComponent

  • Base: UActorComponent.
  • Attachment: AMIPBaseMob.
  • Helper: GetBaseMob() (protected) – returns owning mob actor. Subclasses use this for mob info, loot, etc.

UMIPMobAggroNearbyPlayerSphere

  • Base: USphereComponent (or similar collision component). ClassGroup "Collision".
  • Role: Defines aggro range; when players enter/exit, mob can start/stop combat or reset (e.g. UMIPMobHealthComponent::ResetMobHealthComponent when aggro out of range).

UMIPMobCharacterMovementComponent

  • Base: Likely UCharacterMovementComponent. Custom movement for mobs (speed, behavior).

UMIPMobNameplateWidgetComponent

  • Base: UWidgetComponent (or custom widget component). Displays mob name/health bar above the mob.

UMIPMobPlayerStartComponent

  • Base: Scene/actor component; ClassGroup "Spawner". Used in level to define mob spawn points; game mode or spawner logic places AMIPBaseMob at these locations.

Integration

  • UMIPMobHealthComponent – On death calls GiveMobEXPRewardsAndKill; uses UMIPLootDefinitionAsset for loot; see Health.
  • UMIPBaseModeComponentOnMobSpawned(BaseMob), OnMobDestroyed; wave/session modes track spawned mob count.
  • Quest system can use UMIPEliminateMobQuestTask for kill objectives.