The reason this fails is because the Static Mesh Component header is missing. Add #include "Components/StaticMeshComponent.h" to the top of the Actor's header file.
Starting a hot reload by clicking the Compile button in the Editor fails after adding a Static Mesh Component to an Actor code class. This only occurs in the binary version of the Engine, and only if the project was originally a Blueprint-only project. The error does not occur if the project was originally a code project, or if the Engine was built from source code.
REGRESSION:
Yes, this error did not occur in 4.19.2.
UPROPERTY(EditAnywhere) UStaticMeshComponent* MyMesh;
MyMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MyMesh"));
RootComponent = MyMesh;
RESULT:
The build fails with the following error: error C2440: '=': cannot convert from 'UStaticMeshComponent *' to 'USceneComponent *'
EXPECTED:
The build completes successfully.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-65826 in the post.
2 |
Component | UE - Foundation - Cpp Tools - Hot Reload |
---|---|
Affects Versions | 4.22, 4.20.3 |
Created | Oct 25, 2018 |
---|---|
Resolved | Oct 26, 2018 |
Updated | Oct 29, 2018 |