[4.25.4] Struct variable (Exposed on Spawn pin) on blueprints not updating correctly or not being recognized.

# Problem


The problem that I was having was that even if my code is perfect and works if I close and re-open my UE4 project (same day/next day) it didn’t seem to load the functions at the OnDragDetected and OnDrop inside my Inventory_Slots. Upon printing my struct values I saw that they were not being passed and had the defaults that were set to none.

After debugging I found out that the source of the problem was at the creation of my custom Drag/Drop Operation were I was grabbing a struct variable’s information:


# Fix


What I did to fix this was:

  • Disable Instanced Editable and
    Exposed on Spawn

  • Set the struct value directly after creating the operation.


After doing this every time I reset the project my code works as intended. It seems that the struct pin exposed on spawn is not being recognized or is not loaded correctly upon re-opening the project so I decided to report the possible editor/blueprint bug. This results in the values of the exposed variable staying at default or not showing.

Hope this helps anyone that is having the problem and please let me know if this is a known bug or if there is another fix for this.

2 Likes

Hello,

We’ve made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

Thanks,

I am using UE5.1, there is no Expose On Spawn option for a struct Variable I created, how can I set the Var when spawning the actor?

Having same issue: my old structures can not be exposed in widgets. but new structures can be
(migrated project from 5.1 to 5.1)

Same issue here. I’ve “fixed” it via migrating without any further deps or references from a new 5.2 version to my upgraded 4.27->5.2. I’ve compared both T3D exports via Text-Editor and it seems the only difference between the working (Expose on Spawn visible and working) and the non-working (Expoe on Spawn not visible and not working) is that there are some default values in the 4.27 upgraded struct. Those values are 0 or none anyway but it seems they are causing the issue somehow.