How do you invoke a method using reflection on a UObject?

I’ve just read Unreal Property System (Reflection) - Unreal Engine and I’m not extremely interested in being able to dynamically invoke a function from an object instance in C++.

I can get a reference to a UFunction * using TFieldIterator, but I can’t figure out how to invoke it with it’s required arguments.

How can this be done?

The only example I can find in the engine source seems to be a vastly complicated RPC call…

For the sake of convenience, since this was the first result in Google, the answer can be found here:

1 Like