I’ve got a custom UActorComponent
that fires events when certain touch gestures are recognised. Most of these event delegates pass a custom USTRUCT
parameter, which contains both a pixel screen location and a normalised screen location.
I’ve defined the struct as follows:
USTRUCT(BlueprintType)
struct FScreenLocation
{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FVector2D Actual;
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FVector2D Normalised;
FScreenLocation() {}
FScreenLocation(FVector2D actual, FVector2D normalised)
{
Actual = actual;
Normalised = normalised;
}
};
And my delegates are defined as follows:
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnTapAndHoldDelegate, ETouchIndex::Type, FingerIndex, FScreenLocation, ScreenLocation);
// Triggered when the user holds their finger in the one spot for a period of time.
UPROPERTY(BlueprintAssignable, Category = "Touch Input", meta = (DisplayName = "Tap and Hold"))
FOnTapAndHoldDelegate OnTapAndHold;
The event itself works completely fine and the vectors have correct values, but when I compile the Blueprint Actor that is using the component, I get an error wherever my custom struct is used, saying “No structure in SubCategoryObject in pin Screen Location”:
When I try refreshing those nodes like the error says, the node loses all of its outputs and becomes an empty box that still has an ERROR! below it.
I can easily work around this by removing the struct, but it makes for some long and awkward function signatures.