UProperty primitives, like short or unsigned char

I have a property I wan to expose to the editor and/or blueprint. Its of type short but whenever I add UPROPERTY() I get a compile error.

Is there any way to allow shorts and or unsigned chars to be UPROPERTY?

short testMe;

I couldnt find that in the documentation thanks. So unsigned char is unit8 and short is int16. Thanks!

Short variables are supported in Blueprints. Try using int8 or uint16 or such. See Properties documentation:

No, not all types are supported by reflection system and even more types are not supported by blueprint end property editor. If you get error from UHT i means reflection system does not support that type at all.

But in your case, you using wrong type. UE4 got wrapper types for integers (int8, int16, int32, uint8, uint16, uint32 etc) and insted of “short” you should is “int16”. It still not supported by blueprint (only uint8 aka Byte and int32 aka Integer is supported), but atleast it will compile with UPROPERTY(). All unsupported types can still be used in C++ and and depending on what oyu want to do there technical possibility to do blueprints nodes to control them using supported types (you can convert blueprint supported int32 to int16)

1 Like