x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to make weak object pointer to UINTERFACE-derived class?

It is my impression that an array of GC-aware references to C++ implementations of an Unreal Interface class (declared with UINTERFACE, etc) can be made like so:

 UPROPERTY()
 TArray<TScriptInterface<ISomeUnrealInterface>>

And that an array of GC-Aware weak references to any old UObject can be made like so (notably without any UPROPERTY macro):

 TArray<TWeakObjectPtr<USomeUnrealObject>>

But I am left a bit flummoxed as to how one would make an array of GC-aware weak pointers to unreal interfaces. Is it even possible?

Product Version: Not Selected
Tags:
more ▼

asked Sep 15 '16 at 08:37 PM in C++ Programming

avatar image

adaburns
56 2 3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

For anyone looking for an answer to this old question, check TWeakInterfacePtr<> out. It's defined in GameplayTaskTypes.h

more ▼

answered Mar 13 '19 at 04:07 PM

avatar image

bstone
129 2 13 12

avatar image adaburns Apr 09 '19 at 10:04 PM

Well, I for one am satisfied to have an answer, even if the project it was for has long ago been laid at peace. I will try to test this and accept the answer if I have the time (Though I may end up forgetting—I'm not even working on anything in Unreal at this exact moment).

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question