Flagging an issue that I ran into when working on a State Tree which may catch a lot of people out.
Using a native UStruct as a payload in a state tree OnEvent transition will trigger an ensure assertion if the transition has a delay, and the event payload struct does not implement GetTypeHash method.
Resolving this issue is relatively simple as it just involves us implementing a hashing function that returns a CRC hash of the struct memory. However, this seems like a gotcha which is very easy to mistakenly run into since there is little signposting/auditing around this.
Create a state tree with two states (State A and B)
Use the OnEvent transition trigger for the transition from state A to state B
Make the transition have a delay (any duration above 0 seconds)
Use a native UStruct as the payload for the event that predicates the transition from A to B (crucially the event payload must not define a custom GetTypeHash function)
Fire the event with the custom payload from within state A
Witness ensure assertion that the payload struct does not have a HasGetTypeHash capability
[Attachment Removed]
Thank you for your reproduction steps. I was successful in reproducing this in 5.6. It seems that the UScriptStruct::GetStructTypeHash function has changed a bit since 5.6. The ensure has been removed and I can confirm that this does not occur in the current 5.7.2 release.
If you are interested these changes came in two consecutive commits that can be found here and here.
As far as i can tell there is no public issue tracker for this problem so thank you for flagging this.