I get the error “Unrecognized type ‘template’ - type must be a UCLASS, USTRUCT or UENUM” when I attempt to use a template type on my UFUNCTION.
This is the function:
UFUNCTION(BlueprintCallable, Category = "Bugfix")
template<typename T>
static inline T SetArrayElement(TArray<T>& Array, uint32 Index, T ArrayElement);
It compiles correctly if I remove the UFUNCTION macro, but I was trying to test if I can circumvent a bug that I get with arrays in blueprint by using C++, so I need to keep that part.
I read something about using the Header Tool to circumvent a similar issue, but I actually do not know how to use it and cannot find any instructions online.