Hi, I’m just looking for a little bit more info on the UPROPERTY and UFUCNTION decorators.
I understand their use in terms of variable exposure to the engine but I’m looking for some more info regarding garbage collection.
Currently, if I have a basic variable like a float which I don’t need exposing to the engine, I’ve not put the UPROPERTY decorator on.
However, if I have a pointer to a UObject like UCameraComponent* , I’ve been putting UPROPERTY() ahead of it even if I don’t need it exposing to the engine. I’m assuming that the basic types like floats don’t need garbage collection while the UObjects do?
Is this the correct way of using UPROPERTY()?
As a follow-up, what’s the correct procedure when using UFUNCTION()? I understand how to use it if I need something exposed to blueprint but what do I do if don’t? I’ve watched and read many tutorials and people seem to put it in random places when they don’t need the function exposed to the engine. Some people put it ahead of every function, some people don’t use it at all.
This as left me a little confused as the to the right places to use both UPROPERTY and UFUNCTION.
Anyone got any clarity on these two for me?
Thanks a lot.