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.