No announcement yet.

UMG Circular dependency

  • Filter
  • Time
  • Show
Clear All
new posts

    UMG Circular dependency

    Hi everyone!

    I have issue with UMG circular dependency. An Actor has Pickable component with struct which contains Widget for Inventory. When we pick up the item, it will be destroyed and widget in inventory would be created.

    And furthermore, this widget has pointer to the Actor, it allows us to spawn actor from inventory widget.

    The problem is that in editor mode somehow it works, but when I'm trying to package project an error occures:
    LogInit: Display: LogUMG: Error: PreSave: Null Widget Tree - AR_Widget_C /Game/PlayerCharacter/Blueprints/Weapons_BP/BP_ARRifle_02.BP_ARRifle_02_C:QP_Pickable_2_GEN_VARIABLE.AR_Widget_C_1

    I thought about storing Enum type instead of UClass* pointer and use Factory(EnumType) to spawn items. But this method oblige me to add every new item info to this Factory.

    Will appreciate any thoughts guys
    Last edited by AInsolence; 06-25-2020, 07:52 AM.