If two code components have the same TEXT("") name in the CreateDefaultSubobject call the code will compile correctly but the editor will freeze when adding an instance of the class or classBP to the level.
1. Open UE4Editor (any project)
2. Add Code to project based on Actor (MyActor)
3. In MyActor.h add the following:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) UShapeComponent* Box; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) UShapeComponent* Box2;
4. In MyActor.cpp Add the following to the constructor:
Box = CreateDefaultSubobject<UBoxComponent>(TEXT("Box")); Box2 = CreateDefaultSubobject<UBoxComponent>(TEXT("Box"));
5. Compile
6. Add class instance to the level
Result:
When the instance is added to the level and construction script runs the editor freezes
Expected:
Compile error referencing naming conflict
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.8 |
Target Fix | 4.9 |
Fix Commit | 2602004 |
---|
Created | Jun 24, 2015 |
---|---|
Resolved | Jun 26, 2015 |
Updated | Feb 5, 2017 |