I have a couple questions about best c++ practices:

I’m having trouble getting help on the discord server because of my time zone, so here’s a couple questions regarding c++:

  1. If I’m trying to store and pass
    around an object that I know
    implements an interface, but I don’t
    know anything else about, should I
    set the variable type to be
    IInterfaceName , TScriptInterface,
    UObject*, or something else? How
    should I call BlueprintNativeEvent
    functions and other functions in the
    object using the given variable
    type?
  2. If I want an optional argument for a
    UFUNCTION that will default to a
    value if un-specified, what should I
    do?
  3. Does Tick() run before or after
    BeginPlay()?

If you know the answer to any of these, help would be much appreciated. Thanks.

In the argument list of the header or cpp?

  1. I would store it as a UObject*. But inorder to call non interface functions on it you are going to need a reference of the correct type.

  2. Assign the default value to the argument inside argument list.

  3. After. This would be easy to test by putting a ue log in both and seeing what gets printed first.

I hope this helps!

Header. You could also add it to cpp if you want.