Skip to main content

Extension ViewModels

The base UEDInteractionViewModel supports “extensions” via a map:

  • TMap<TSubclassOf<UMVVMViewModelBase>, UMVVMViewModelBase*> ExtensionViewModels

This is designed to let interactables inject extra MVVM data without changing the base UI contract.

Adding extensions

The player component clears extensions and then asks each fragment:

  • UEDInteractionFragment::OnInteractionStarted(UObject* Outer, UEDInteractionViewModel* BaseViewModel)

If a fragment returns a ViewModel, the player component calls:

  • UEDInteractionViewModel::AddExtensionViewModel(UMVVMViewModelBase*)

Retrieving extensions

From Blueprints (or C++), the widget/viewmodel can query:

  • GetExtensionViewModel(ExtensionClass)

This allows you to bind additional UI panels to optional data that only some interactables provide.

  • Keep the base widget always present and stable.
  • Add optional panels for specific interactable types.
  • Use extension ViewModels to drive those panels.