Error: Unable to find ‘class’, ‘delegate’, ‘enum’, or ‘struct’ with name ‘FRotationMatrix’
My codes are:
UFUNCTION(BlueprintCallable)
FRotationMatrix Convert(const FRotator& Rot);
Error: Unable to find ‘class’, ‘delegate’, ‘enum’, or ‘struct’ with name ‘FRotationMatrix’
My codes are:
UFUNCTION(BlueprintCallable)
FRotationMatrix Convert(const FRotator& Rot);
It’s probably because FRotationMatrix is not defined as a direct struct.
inside of RotationMatrix.h you can see that all of the functions are templated and return TMatrix of a specific type.
All internal functions are also static and the only part where the struct is declared is through:
UE_DECLARE_LWC_TYPE(RotationMatrix, 44);
where LWC is a declaration for large world coordinates. This comes with the down-side that it uses large internal numbers (usually 64 bit unsigned variables) that cannot be represented in blueprints.
You cannot expose these types of elements to blueprints as they cannot be represented there hence if you add UFUNCTION(BlueprintCallable) the compile will fail.
If you keep it pure c++, not exposed as a UFUNCTION then it will compile no problem, but it needs to be used purely in the c++ realm
.
As 3dRaven states, it’s a templated static class - you can make your own node that just uses this code:
FMatrix myRotationMatrix=FRotationMatrix::Make(FRotator(0,0,0));