Adding DoNotCreateDefaultSubobject to a class after placing an instance of that class in the viewport will fail to be recognized when duplicating the placed instance. This is not a hot reload issue, behavior also occurs if the editor is closed when compiling.

No- Behavior also occurs in 4.14.3 binary (CL 3249277)

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add code to project based on Player Start (MyPlayerStart)
  3. Add the following code to MyPlayerStart.h
    	AMyPlayerStart(const FObjectInitializer& ObjectInitializer)
    		: Super(ObjectInitializer.DoNotCreateDefaultSubobject("Arrow")) {    }
  4. Compile
  5. Add instance of MyPlayerStart to the viewport
  6. Save and close the editor
  7. Change Super(ObjectInitializer) to Super(ObjectInitializer.DoNotCreateDefaultSubobject("Arrow"))
  8. Compile
  9. Restart the editor (note arrow is missing from placed instance)
  10. Select placed instance of MyPlayerStart
  11. Ctrl+W to duplicate the instance then deselect it

Duplicated copy still have arrow component showing

Duplicated instance follows code rule of not creating default components when set

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-43019 in the post.

Login to Vote

ComponentUE - Foundation - Core
Affects Versions4.
Target Fix4.16
Fix Commit3392220
Main Commit3427032
Release Commit3392220
CreatedMar 17, 2017
ResolvedApr 13, 2017
UpdatedMay 6, 2017
View Jira Issue