It’s all blueprints and I have no clue where it’s really coming from. It often happens when I start or stop PIE but it also happens at other times and the error is so vague so it’s been tough to track down. Anyone got any ideas?
Update: I’ve narrowed down that it’s likely a dispatcher issue. That’s what I suspected in the first place but a few other threads seem to confirm it, notably this one.
I’m unsubscribing my dispatchers properly in Destruct/ReceiveDestroy/ReceiveEndPlay but I guess something isn’t actually being unsubbed? I go through and unsub each event that’s been subscribed to a dispatcher then I unscribe all events from each of the current object’s dispatchers. Not sure if I should be doing something differently?
Update 2: So now I’ve got a completely new theory. I’ve tracked it to the function I have bound to “OnGenerateWidget” on my combo box. For some reason unbinding it seems to make things run fine but the second that function is bound I get periodic crashes again (whether or not I interact with it).
Nothing seems immediately off with the function or the widget content that I’m using but that’s definitely the source of it.
Weeks from first finding this, finally figured it out! The spawnactor/createwidget nodes don’t update properly when you change variable types from a struct to a different type of struct which allows for mismatched types and then causes crashing when trying to actually access the values they contain.
Just submitted a bug ticket and I’ll mirror it here for anyone else that might run into this.
Issue:
SpawnActor / CreateWidget nodes don’t update allowing for mismatched types if they’re structs (causing frequent, seemingly unrelated crashes)
Repro:
Create a BP actor called that will be spawned (a)
Create a BP actor that will spawn (b)
Create a variable of any type (c) on (a) and set it to expose on spawn (and instance editable)
In (b), create a spawn actor node and set it to spawn type (a)
Create a struct variable of type (c) and plug it into the spawn node to fill that variable on spawned actor (a)
Go back to the blueprint for (a) and change that variable’s type to any other struct then compile
Return to the blueprint for (b), you will now have a mismatched type of struct variable being plugged into the spawn node for (a)
7.1 If the spawn actor node isn’t updating to reflect the change, sometimes adding an extra variable on (a) will cause it to fully update. Regardless, you still have a mismatched type.
I first encountered this following a similar process with CreateWidget but in trying to repro I noticed it works the same with SpawnActor.
Results:
Mismatched type is accepted.
Expected:
Compile error with a red connection the way changed/mismatched variable types are usually handled.
Description:
In my case (doing this with widgets) I got frequent crashes documented in this thread. They would occur whether or not the widget was directly interacted with after a variable amount of time, sometimes on starting PIE, and sometimes on ending PIE.
Particularly nefarious because without a compile error, with delayed onset, and with an editor-level crash the actual issue wasn’t really traceable. Ended up just removing things piece by piece from my scene until I found the problem BP and then removing things from that piece by piece until I found the problem node.