No way to make BlueprintCallable that accepts 'FBox2D'

UE 4.10.2

If I have

UFUNCTION(BlueprintCallable)
void OnBoundsReady(FBox2D Bounds);

Or

UFUNCTION(BlueprintCallable)
void OnBoundsReady(FBox2D& Bounds);

UHT generates:

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
	C++ class header boilerplate exported from UnrealHeaderTool.
	This is automatically generated by the tools.
	DO NOT modify this manually! Edit the corresponding .h files instead!
===========================================================================*/

#include "ObjectBase.h"

PRAGMA_DISABLE_DEPRECATION_WARNINGS
struct FBox2D;
.....

Because of that the class fails to compile with error: 'FBox2D': type name first seen using 'class' now seen using 'struct', since it’s not a struct, it’s a class, as can be clearly seen in Box2D.h

If I try to pass FBox2D by pointer, I get this UHT error:
Inappropriate '*' on variable of type 'FBox2D', cannot have an exposed pointer to this type.

I think UHT thinks that FBox2D is a USTRUCT (but it’s not) and refuses to pass it by raw pointer.

As a workaround, passing 2 FVector2D works fine, but it would be nice to be able to send FBox2D instead.

EDIT: I’ve updated the question. Turns out it had nothing to do with delegates - error is caused by UFUNCTION(BlueprintCallable) meta.

The UHT will treat anything that isn’t a pointer as a struct. Try using FBox2D* as your type. It has a habbit of changing your variable types to suit its world view, not your intended one.

Edit: Tired. Make it a pointer?

Making it a pointer (DECLARE_DELEGATE_OneParam(FMyHUDSizeInitialized, FBox2D*);) makes no difference =S
EDIT: Turns own it has nothing to do with delegates. See the above modified question.

Then it might be because it starts with F. UHT expects classes to start with U or A. I’m assuming this box has 4 floats? You could try sending 2 FVector2Ds instead. Or an FVector4.

As a workaround using 2 FVector2D works fine. It would be nice to be able to use FBox2D though.

Hello grisevg,

I can’t find a bug report for this in particular or I’d give you the specific GitHub commit, but it seems that this issue is fixed in 4.11 Preview 3 and in our future builds. Hopefully the workaround will work for you until 4.11 officially releases and then you should be able to upgrade and get this functionality.

Have a nice day!

Awesome, cheers!