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"

Is that appropriate having a UPROPERTY() member inside a Non-UObject class

I have seen this for a couple of times when I have a UPROPERTY() member pointer inside a F-prefixed class (one that does not inherit from UObject). As entering PIE mode, the pointer is always reset to default value being set inside the class.

So I guess there is no meaning of having that member for a non-UObject class, right?

Thanks in advance for any confirmation!

Product Version: UE 4.21
Tags:
more ▼

asked Mar 18 '19 at 09:01 AM in Using UE4

avatar image

Tadinu
1 1 2

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

1 answer: sort voted first

Yes, UE4 reflection system only supports UObjects with UCLASS and you can use UPROPERTY also in USTRUCT

Note that those are just markers for UHT to generate extra code that registers those property, they are empty macros so compiler simply paste nothing and won't throw any error regardless where you place them GENERATED_BODY() is the spot where everything is pasted to the class.

more ▼

answered Mar 18 '19 at 09:31 AM

avatar image

Shadowriver
35.9k 928 169 1105

avatar image Tadinu Mar 18 '19 at 10:22 AM

Thank you, Shadowriver! By the way, as I understand that only registered property with UPROPERTY(), due to not being garbage collected prematurely, could retain its value as entering PIE mode?

(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