Skip to content

Character Components

Overview

Character components attach to the Pawn (or character) and handle hero-specific behavior, movement, and nameplates. UMIPHeroComponent is the main pawn component that binds movement speed to the ability system. UMIPCharacterMovementComponent extends Unreal's character movement (ground info, replicated acceleration, custom speed). UMIPAdvNameplateCreatorComponent creates nameplates (including health) for players and uses the MIP player controller.

Key traits:

  • UMIPHeroComponent – Listens to pawn ready; binds to attribute change for movement speed and syncs with ASC.
  • UMIPCharacterMovementComponent – UCharacterMovementComponent subclass; ground trace cache, jump/accel/speed overrides.
  • UMIPAdvNameplateCreatorComponent – Extends MIPChatSystem's UMIPNameplateCreatorComponent; creates player health nameplate widget; tracing and "other pawn" nameplate logic.

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


Key Classes & Files

Class File
UMIPHeroComponent Public/Character/MIPHeroComponent.h
UMIPCharacterMovementComponent Public/Character/MIPCharacterMovementComponent.h
UMIPAdvNameplateCreatorComponent Public/Character/MIPAdvNameplateCreatorComponent.h

UMIPHeroComponent

  • Base: UMIPBasePawnComponent.
  • Attachment: Player pawn (ACharacter).
  • Flow: BeginPlayOnPawnComponentReady_ImplementationSetInitialAndBindMovementSpeedChanged(); BindDelegates_Implementation. Listens to movement speed attribute via OnMovementSpeedChanged(OnAttributeChangeData).
  • API: SetMovementSpeed(InMovementSpeed) (BlueprintCallable). Helpers: GetMyCharacter(), GetMovementComponent().

UMIPCharacterMovementComponent

  • Base: UCharacterMovementComponent (Engine).
  • Struct: FMIPCharacterGroundInfo – LastUpdateFrame, GroundHitResult, GroundDistance; updated on demand via GetGroundInfo().
  • API: GetGroundInfo() (updates cache if needed), SetReplicatedAcceleration(InAcceleration). Overrides: SimulateMovement, CanAttemptJump, GetDeltaRotation, GetMaxSpeed.

UMIPAdvNameplateCreatorComponent

  • Base: UMIPNameplateCreatorComponent (MIPChatSystem).
  • Attachment: Typically on a controller or actor that manages nameplates for the local player's view.
  • Override: InitNameplateCreator() – waits for MIP PC via UMIPWaitForMIPPCValidBPAsync, then OnMIPPCValid. DoTracing_Implementation, OnClientPlayerStateInitialized, TryCreateNameplateForOtherPawn. Creates health nameplate via CreatePlayerHealthNameplateComponent(InActor) (returns UMIPPlayerHealthWidgetComponent).
  • Config: HealthRelativeLocation (EditAnywhere) – offset for health nameplate widget (default Z=90).

Integration

  • Movement speed is driven by the ability system attribute; UMIPHeroComponent bridges that to the movement component.
  • Nameplates are used by the chat/UI system; health nameplate shows UMIPPlayerHealthComponent (or equivalent) data.