Use of UFUNCTION() for C++ helper functions

Hi,

This is a bit of a silly question, but is there any point in declaring a ‘‘helper’’ C++ function UFUNCTION()?

Basically, I have some functions that take care of doing logic that does not need to be exposed at all to Blueprints. Think of helper functions that update internal variables, do specific calculations, etc. Do they still need to be marked as UFUNCTION()? I notice that I can’t see any difference either way.

Apologies, I am still a bit unsure of what has to be reflected to ensure the engine works as intended.

Cheers,
M

If they don’t need to be called from BP, you don’t need to decorate them. It can help to expose them to reflection for some advanced things like getting all functions of a class or using Kangen for docs, but the engine doesn’t require it for anything other than BP exposure.

Thanks for the reply! I thought that it would have some purpose. Much appreciated.

1 Like